Why the debugger doesn't work

Find below the steps that solved my problem:

  1. Delete ASP.NET temporary files from C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
  2. Change build configuration to debug from project properties.
  3. Delete bin folder from your project.
  4. Check if compilation debug is set to true in the web.config
  5. iisreset
  6. 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.