Copied to clipboard

Flag this post as spam?

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


  • Mikael Mørup 297 posts 326 karma points
    Mar 09, 2010 @ 08:44
    Mikael Mørup
    0

    Debugging problem

    I use Visual studio 2008 a lot to develop usercontrols for use in Umbraco (both version 4.0.2.1 and 4.0.3) Everything running on a Windows 2003 seerver, but it also happens when running on Vista.

    I follow the guidelines from the Umbraco TV episode on debugging, except the "Attach to process" menu item is in the tools menu and not in the debug menu.

    But sometimes, without any obvious reason debugging just stops working.

    I have the bin and pdb files in the bin folder, i attach to the w3w process, but my breakpoints are never reached, and the web page just loads as it normally would without debugging.

    Sometimes this happens just once or twice, sometimes it's almost every time i try to debug.

    Does anybody know what is going on and what i can do to get my debugging working all the time.

    Thanks

    Mikael

  • Jesper Hauge 298 posts 487 karma points c-trib
    Mar 09, 2010 @ 09:14
    Jesper Hauge
    0

    Sounds like your web-server spins up a new process in the midst of debugging. Do you by any chance edit some files in the live folder during debugging that might cause the web-server to recompile the project?

    Regards
    Jesper Hauge

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Mar 09, 2010 @ 10:00
    Lee Kelleher
    0

    Hi Mikael,

    Quick check... are you compiling in Debug mode, (as opposed to Release mode)?  It's caught me out a few times.

    Cheers, Lee.

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Mar 09, 2010 @ 10:22
    Sebastiaan Janssen
    0

    Also, make sure that you're not looking at cached items, so if you're debugging a macro that has caching turned on, the result of the first call of the macro will be used instead of the code running again.

    I've detailed another way to debug in a blog post. In my humble opinion this way is easier than having to attach to process each time, just hit F5 in Visual Studio and go for it.

  • Mikael Mørup 297 posts 326 karma points
    Mar 09, 2010 @ 10:53
    Mikael Mørup
    0

    @jesper: No i don't think any file are written to / edited. Its a develoment project that only i am accessing.

    @Lee: I asume that i'm in release mode because the PDB files are generated and put in the umbraco bin folder with each compile.

    @Sebastian: i removed all caching from the macro and the problem is still there.

    thanks

    Mikael

     

     

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Mar 09, 2010 @ 11:41
    Lee Kelleher
    2

    Hi Mikael, sorry, meant to say - make sure you are in Debug mode.

    On old versions of Visual Studio, Release mode didn't output PDB files, but since VS2005 they do ... so it can be confusing which mode you are in.

    In VS2008, go to the menu "Build > Configuration Manager" and check which is the "Active solution configuration" ... if it's not Debug, then make sure it is.  If it is Debug... then there's a different problem.

    Let us know.

    Cheers, Lee.

  • Mikael Mørup 297 posts 326 karma points
    Mar 09, 2010 @ 21:16
    Mikael Mørup
    0

    In my build menu (VS 2008  pro.) i only have build, rebuild, clean and publish.

    No Configuration manager.

     

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Mar 10, 2010 @ 10:58
    Sebastiaan Janssen
    1

    Sounds like something is wrong with you VS. In the toolbar (just the standard toolbar), you have a "Play" button to start debugging, next to it should be a dropdown in which you can select "Debug", "Release" and "Configuration Manager". Set this one to Debug and make sure that in the configuration manager "Debug" is also chosen for the project you want to debug.

    Check your web.config, specifically this key: 

    <add key="umbracoDebugMode" value="true"/>

    and this one: 

    <compilation defaultLanguage="c#" debug="true" batch="false">

     

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Mar 10, 2010 @ 11:01
    Lee Kelleher
    0

    Doh! Forgot about mentioning the Web.config setting... good point Sebastiaan! (+1)

  • Mikael Mørup 297 posts 326 karma points
    Mar 10, 2010 @ 14:18
    Mikael Mørup
    0

    Thanks.

    I will check up on it when i get back to my development system later today.

     

    Mikael

Please Sign in or register to post replies

Write your reply to:

Draft