Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ayo Adesina 445 posts 1058 karma points
    Nov 19, 2011 @ 22:47
    Ayo Adesina
    0

    Debuging using Visual Studio - Very Frustrating

    I have got umbraco running working ok no problems, I can work on files in visual studio then using web matrix I can run the site which appares as http://localhost:6590 in my web browser.

    OK heres the problem I have a user control that has a .cs file with some code, I want to step through the code as it is executed so that I can see what is going on, but I cant get it to hit the fucking break point. Sorry for the rant but I just don't know what else to do.

    So you are on the same page as me...

    1. Created a website through web-matrix choose umbraco followed the installation steps

    2. Go to web matrix > files > Visual studio. Visual studio starts and all the files for the website are there, so I make a macro in umbraco which is a user control that just says 'Hello World' 

    3. Attach VS to iisexpress.exe

    3. I put a break point in the onload and then run the site by going to the web matrix and clicking the url http://localhost:6590 and the macro runs and displays but the break point wont hit!.....

    OK while writing this post I found the answer and as it has pissed me off so much I think its best I write the solution...well my half hacked but working soultion.

    After you create the site in webmatix and go to visual studio (Files > Visual Studio) CLOSE WEB MATRIX, push play in visual stuio, it will try and build the site and run it...it wont work becuase you will get errors about some umbraco webservices, I just exculded all of them from the project. Then push play and it works :-) what a waste of time...

    I am sure I am missing something...but hey..it works.....for now.

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Nov 20, 2011 @ 16:23
    Jan Skovgaard
    0

    Hi ayo

    When you're debugging, are you then attaching to the w3wp process?

     

    EDIT: Nevermind me, oversaw that you're using issexpress and is attaching to the process. #h5is :)

    /Jan

  • Rodion Novoselov 694 posts 859 karma points
    Nov 21, 2011 @ 07:34
    Rodion Novoselov
    0

    Also you need to make sure that your 'system.web/compilation/debug' setting in the web.config file is set to "true". When you install Umbraco from the installation archive it's initially set to 'false' by default.

  • Bex 444 posts 555 karma points
    Nov 21, 2011 @ 18:04
    Bex
    0

    A suggestion if you have IIS.. (and are a developer as it sounds like you are and know how it all works)

    Just take the umbraco files and stick them in a development folder or even leave them where they are and reference them with IIS! (much easier) 

    Also an easier way to debug;

    Add your umbraco website to your VS solution that contains your custom controls.
    Then add your custom project as a reference to your umbraco website (you will need to delete the custom dll from the umbraco sie first as it will say a reference already exists)

    Set the umbraco site as your start up project and then go to the properties of the solution and go to "configuration properties" and make sure your umbraco website is unticked under the build column. (reason for this is the unmbraco site won't build)

    You will still need to copy across your usercontrols (or set a build event to do this automatically) but instead of having to attach to the process just stick your breakpoints in your custom project and run the project and the umbraco site will run and your breakpoints will automatically be attached!  Much much easier!

     

     

Please Sign in or register to post replies

Write your reply to:

Draft