Why the debugger doesn't work
Find below the steps that solved my problem:
- Delete ASP.NET temporary files from
C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
- Change build configuration to debug from project properties.
- Delete bin folder from your project.
- Check if compilation debug is set to true in the web.config
- iisreset
- Rebuild the project.
There are a couple of things that could be wrong:
- Your source code and assembly could be out of sync - rebuild the application and try again.
- You could be attached to the wrong process - check to see what process you are attached to.
- There could be a logical error in your code that is causing your breakpoint to not be hit (i.e. the method you are in is not actually called, logical branching is routing control around the breakpoint, etc.)
The symbols probably aren't loaded, that's why the breakpoint won't be hit. Did you set the website as the startup project?
When debugging, what process it attached? It should be w3wp.exe if you want to debug asp.net code.