I do a lot of contracted work in ASP.NET (C#). In fact, you could say a major part of my working day is spent on debugging or developing features for a client in ASP.NET 4 (C#).
I was recently faced with a really strange problem. I was experiencing extremely slow loading times when attempting to debug web applications in Visual Studio 2010. The Debug output was showing messages like the one below:
WebDev.WebServer40.EXE (Managed (v4.0.30319)): Loaded C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\07223a54\95651cd9\assembly\dl3\ea151d54\00459b65_4916cc01 \Microsoft.Web.Administration.resources.DLL
Even postbacks were taking longer then usual. I couldn’t for the world of me remember if I did anything to change the behaviour of my Visual Studio installation so I Googled for a quick answer – as one does in such situations :).
Some answers suggested deleting all breakpoints because corrupt breakpoints might be causing problems. I did that.
Others suggested attempts to load symbols from msdn servers was the culprit so I made sure symbols were not being loaded from the web.
ScottGu got me to remember that I did indeed play around with an expired certificate in the last week or so – so I made sure my solution wasn’t including the project in question.
Finally, I remembered I had recently also enabled tracing through my web.config file in order to track down a hard to find bug and in doing so I had set the attribute writeToDiagnosticsTrace of the trace element to true, outputting everything to the diagnostics trace obviously, including all the “loading” messages.
After this, I am thankfully back to loading my Web Applications in debug mode within no time at all.