Why can't I debug my asp.net web project anymore?

10,934

Solution 1

If you have recently upgraded your solution / project to .Net 4.0, your code type when you select to debug may still be 'Managed (v2.0, v1.1, v1.0)' and not 'Managed (v4.0)' meaning your breakpoints will not be hit.

When you choose "Debug > Attach to Process" in visual studio before selecting your process e.g. "w3wp.exe", click the 'select' button of the 'Attach to' section and select the 'Managed (v4.0)' option.

Hope this helps.

enter image description here

Solution 2

Try this:

  • Clean and recompile your solution.

or

  • Be sure to close ASP.NET development server, or reset IIS (iisreset /restart).

or

  • Be sure ALL projects are in 'Debug' mode.

or

  • Be sure ALL projects are targeted to the same .NET Framework version.

Solution 3

See http://connect.microsoft.com/VisualStudio/feedback/details/635045/visual-studio-2010-hangs-during-debug-or-using-attach-to-process

and the hotfix

http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=30738

Maybe it works also for your kind of problem.

Share:
10,934
Shaul Behr
Author by

Shaul Behr

Husband, father, grandfather, software architect, Orthodox rabbi, fiction author, fitness enthusiast. https://shaulbehr.com

Updated on June 04, 2022

Comments

  • Shaul Behr
    Shaul Behr almost 2 years

    Something has changed in my ASP.NET web project... I used to be able to debug. Now my breakpoints are being ignored. I checked my web.config, and it says:

    <compilation defaultLanguage="c#" debug="true" targetFramework="4.0">
    

    So that all seems in order. What else might be messing up my debug environment?

    EDIT: I should also mention that when I run a console app, breakpoints work fine. It's only when I run the web app that breakpoints just don't happen.

    This only happens when I'm debugging using IIS. If I use the VS Dev Server, my breakpoints work!

  • Shaul Behr
    Shaul Behr about 13 years
    Nah, everything is in debug mode.
  • dplante
    dplante over 11 years
    this tip totally helped me! thank you!!!!! (my options were set to Managed v2.0, etc)