A couple of days ago one of our .NET developers asked me to help solve an issue on his machine. He said that his breakpoints were not being hit due to missing symbol files. I asked him to close Visual Studio and show me step by step how he debugs.
- He started Visual Studio 2005
- He opened his solution
- He publishes his site to c:\inetpub\wwwroot\<project>
- He navigates to the website using IE
- He sets a breakpoint
- He attaches to the worker process
The breakpoints will not be hit and I explained him why. Publishing your web site cause your web site to be pre-compiled using the executable apsnet_compiler.exe. The problem here, if you can even call this a problem, is that by default the debug info will be omitted.
There are several ways to solve this:
- Use Visual Studio 2005 Web Application Projects which shares the compilation semantics known from ASP.NET 1.1
- Do not publish your site instead xcopy deploy the site
- On your dev machine you can point the virtual directory to your ASP.NET project directory
- Pre-compile manually with aspnet_compiler.exe -d to emit the debug info
Cross-posted from
The .NET Aficionado