Hello all,
I am writing this post after much research I had to do since I wanted to debug my web site in pre-production (or Staging mode). This is not a live server but very close to the target configuration and it's not a development machine.
I am running with ASP.NET 2.0 and DNN 4.3.5. In ASP 2.0, the compiling model has changed and it wasn't clear from MSDN how things exactly work. This post is a bit more clear on what's going on under the hood:
http://odetocode.com/Blogs/scott/archive/2005/11/15/2464.aspx
Then I was doing a Publish Web from VS.NET 2005, and I was wondering why the PDB files are not generated, even when debug="true" was set in web.config. Then I realized that I have to use a manual publish by running this command from the prompt:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -d -f -fixednames -p d:\dnn\Website -v /dotnetnuke_2 d:\dnn\debug
So now d:\dnn\debug also contains the PDB file in addition to the DLL in the bin directory.
After copying this folder to the server and setting up IIS and DNN as usual my site was up and running, but it has bugs and I had to debug with sources.
At this point make sure that debug="true" in your web.config on the server.
I downloaded the .NET Framework 2.0 SDK (a 300+ MB package!) just to install the tools. Specifically I needed DbgClr.
With DbgClr I attached to the aspnet working process. On XP it's aspnet_wp.exe. On Windows 2003 it's called w3wp.exe. The problem is that there can be several of those, and the system don't tell you easily which one is running your DNN (I created my own Application Pool, so I had 3 w3wp.exe processes).
OK, after figuring this one out, you can now copy the sources to the machine as well, open a specific source file and place a breakpoint. Just make sure the sources match the binaries, as DbgClr does not like otherwise.
That's about it.
Good luck!
Ofer