views:

2663

answers:

1

I have sit up remote debugging on a Window 2003 server accessed through the Internet. I have VS 2008 SP1 installed on my XP dev box.

I launched the site on the remote server and attached to all the w3wp.exe processes on the remote server. I noticed that the .dll did not load the symbols file. When I try to load the corresponding .pdb file from my local machine, it says file does not match. I have "Require source files to exactly match the original version" unchecked. The assembly on the remote server is the same as the one on my dev box. The site and .dll was copied from dev boc to remote server and code hasn't changed since. So I know .dll and .pdb files should match or at least I need to force the matching.

Questions:

  1. How do I get the .pdb file to load? I know breakpoints won't trigger unless symbols file is loaded. I noticed that the .pdb file does not exist in the "Temporary ASP.NET Files" folder on the remote server. The .dll does.

  2. What's the proper sequence to start debugging remotely inside VS? (Remote set up is done and I can see remote processes). In VS, I have start page as the url of the remote site. I start without debugging and then attach to w3wp.exe(s) on the remote. Is this all?

+2  A: 

Are you running a Web Site or a Web Application (is it a compiled project, that you deploy the DLL for, or a collection of aspx and aspx.cs files that you deploy)?

If it's a Web Application, did you deploy a release build, or a debug build? You won't be able to hit breakpoints when "debugging" a release build, as the code is fairly heavily optimised.

Have you got "debug=true" set in the web.config compilation section? If not, again, debugging is going to be difficult.

Finally, the steps I use when remote debugging are:

  1. Deploy latest debug build of files
  2. Request page on remote server to start/restart application
  3. Ensure that the VS Remote Debugging Monitor is up and running on the remote server
  4. In VS, go to Tools (or Debug) | Attach to Process..., ensure that the remote server is selected in the Qualifier, and select w3wp.exe for the correct app-pool, etc.
  5. Request page that will fire break point.
  6. Debug!

If the breakpoints are hollow (thin red circles rather than filled disks), I'll often check the Stack window in VS to see what has and hasn't been loaded.

Zhaph - Ben Duguid
It's a web application and not website application. Everything you mentioned has been done. However my first question still stands. How do you get the .pdb file to load and where does VS expect it to be? Looking at the site's log, I am not seeing DEBUG commands being recorded.
Abdu
Also I can't find %tmp%\Visual Studio Web Debugger.log file. I looked in the %tmp% folder, I looked under the documents and settings folder tree and the VS itself tree. Is there a setting in VS to enable this logging?
Abdu
How does VS determine that the dll and .pdb do not match? Timestamps? Some content? They should match because I am copying the files from my local machine to the remote server.
Abdu
Sorry for the delay: I generally have the .pdb in the web application's bin directory, alongside the .dll.
Zhaph - Ben Duguid