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.
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?
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.
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.
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.
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
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
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.
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.
@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
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.
In my build menu (VS 2008 pro.) i only have build, rebuild, clean and publish.
No Configuration manager.
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:
and this one:
Doh! Forgot about mentioning the Web.config setting... good point Sebastiaan! (+1)
Thanks.
I will check up on it when i get back to my development system later today.
Mikael
is working on a reply...