Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I unable to Debug my ASP.NET website in Visual Studio?

Tags:

I used to be able to attach to my w3wp process and Debug my web application, but this is not working anymore. I have no idea what changed to break this. I'm using Visual Studio 2008 SP1. And I'm debugging in IIS, not using ASP.NET's own server (i.e. I don't Run my project, I simply attach to a running process (w3wp).

My breakpoints simply have the "breakpoint will currently not be hit. The source code is different from the original version."

What I have tried:

  • Did a solution Clean.
  • Did a solution Rebuild.
  • Made sure that compilation debug=true in my web.config file.
  • Deleted the bin folder
  • Restarted Visual Studio
  • Restarted IIS
  • Restarted my Computer
  • Added a simple Response.Write to ensure that the latest DLL is being used. It is.
  • Made sure that Debug ASP.NET is checked in my project properties. It is.
  • Made sure that all my projects are compiled in my build configuration. They are.

But none of these help. I attach to w3wp, but my breakpoints never get hit.

Any ideas?

like image 583
willem Avatar asked Mar 15 '10 11:03

willem


People also ask

How do I enable debugging in Visual Studio?

In Solution Explorer, select the C# or Visual Basic project node and select the Properties icon, or right-click the project node and select Properties. Enable native code debugging in the properties.

How can I tell if debugging is enabled in asp net?

Debugging is enabled when the debug attribute in the compilation element is set to true. Change the debug attribute to false to disable debugging for that application. Save the Web. config file.


1 Answers

I had this problem recently and I ended up first making sure Visual Studio was not running at all on the system.

Then went into this folder and deleted all its content:

C:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
like image 180
Gautam Avatar answered Oct 20 '22 20:10

Gautam