Visual Studio 2008 Hangs When Debugging ASP.NET App

I’ve been doing some work with ASP.NET MVC but was having periodic issues with Visual Studio 2008 hanging (freezing / becoming unresponsive) when I tried to run my web application with debugging.  The problem only occurred with a specific web project.

I tried deleting the Temporary ASP.NET Files (%userprofile%\AppData\Local\Temp\Temporary ASP.NET Files) but that did not solve the problem.

I tried deleting the obj folder.  No luck.

I tried waiting it out one evening.  I eventually feel asleep and when I awoke sometime in the middle of the night, my web app was happily waiting for input and Visual Studio debugging was completely responsive.  That proved to be a temporary salve.

showallfiles The problem resurfaced again a few days later and I finally figured out the problem with my uncooperative debugger.  I have a folder containing approximately 20,000 images that are not included in the Visual Studio web project but are sitting in a directory in the web site.  I had turned on "Show All Files" in Solution Explorer to add some script files into the project.  When "Show All Files" is off, F5 (Start Debugging) works like  champ.  When "Show All Files" is on, Visual Studio becomes unresponsive.  In reality it is not "frozen" but simply taking a very long time to process those 20,000 image files.

Mystery solved.

11 thoughts on “Visual Studio 2008 Hangs When Debugging ASP.NET App

  1. hi thx!! That finally solved my problem – did look everywhere and just was not able to debug a solution – nothing int it… Every other solution was just fine and that did drive me crazy – on all other developers machines everything was fine.


  2. Hi,

    Unfortunately it’s not that easy, this problem still occurs in a newly created WebApplicationProject with no other files than default for the project, if i turn on “Show All Files” it still hangs, so it doesn’t seem to have any relation to whether or not you have some 20,000 files or just one.

    But still, this is somewhat a know bug in Visual Studio 2008, why no fix has been introduced I have no idea. This was even know long before VS2008 SP1, but SP1 didn’t fix it.

  3. Thanks. This just resolved my issue !! I had been looking for the solution throughout Google search and all of the pages were talking about the issue that you are not able to attach to process AT ALL !! But in my case…. I knew I was able to attach to process as it worked like a champ till yesterday. So the solution was not meant for me. This solution just worked perfect for me as I accidentally clicked on show all files and was trying to attach debugger as so VS2008 became unresponsive!

    Thanks again….it was so frustrating issue. 🙂

  4. Thank you so much. You’ve solved a mystery that was starting to give me a terrible headache.

  5. Really thank you.
    I’m just wondering why they need to process all those files. Just for doing sth.?

Comments are closed.