本文翻译自:Visual Studio debugging/loading very slow
I'm at wits end. 我的智慧结束了。 Visual Studio is typically painfully slow to debug or just plain load ("start without debugging") my ASP.NET MVC sites. Visual Studio 通常很难调试,或者只是简单地加载(“启动而不调试”)我的ASP.NET MVC站点。 Not always: at first, the projects will load nice and fast, but once they load slow, they'll always load slow after that. 并非总是如此:首先,项目将加载得很好而且速度很快,但是一旦加载速度变慢,它们总是会在此之后加载缓慢。 I could be waiting 1-2 minutes or more. 我可以等待1-2分钟或更长时间。
My setup: 我的设置:
I'm using Visual Studio 2012 Express , currently, but I've had the same problem in Visual Studio 2010 Express as well. 我目前正在使用Visual Studio 2012 Express ,但我在Visual Studio 2010 Express中也遇到了同样的问题。 My solution is stored on a network drive; 我的解决方案存储在网络驱动器上; specifically, it's My Documents redirected to a network drive, if it matters. 具体来说,如果重要的话,它的My Documents会重定向到网络驱动器。 (It shouldn't. There are times where my site loads very fast under this setup.) (它不应该。有时我的网站在此设置下加载速度非常快。)
I load in Internet Explorer 9 usually, but the same problem happens in Firefox. 我通常在Internet Explorer 9中加载,但在Firefox中也会出现同样的问题。
This can happen in any ASP.NET MVC project I work on, and it seems to revolve around having DisplayTemplates, which all my ASP.NET MVC projects do. 这可能发生在我工作的任何ASP.NET MVC项目中,它似乎围绕着DisplayTemplates,我的所有ASP.NET MVC项目都是这样做的。 And it's all C# and Razor, if that mattered. 而这一切都是C#和Razor,如果重要的话。
Symptoms: 症状:
The system will load my symbols hundreds of times. 系统将加载我的符号数百次。 Basically, the following, but there are at least 300 such rows, each with ever-so-slightly different DLL files for the same CSHTMLs: 基本上,以下,但至少有300个这样的行,每个行对于相同的CSHTML,每个都有不同的DLL文件:
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b63f8236\6775085d\App_Web_contact.cshtml.22013bb9.xighmhow.dll', Symbols loaded.
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b63f8236\6775085d\App_Web_contact.cshtml.22013bb9.cv5hktkf.dll', Symbols loaded.
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b63f8236\6775085d\App_Web_statuscode.cshtml.22013bb9.1o77hs8i.dll', Symbols loaded.
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b63f8236\6775085d\App_Web_statuscode.cshtml.22013bb9.jja-77mw.dll', Symbols loaded.
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b63f8236\6775085d\App_Web_location.cshtml.22013bb9.l_e9ev_s.dll', Symbols loaded.
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b63f8236\6775085d\App_Web_location.cshtml.22013bb9.b4n59gom.dll', Symbols loaded.
In the above, I've got three DisplayTemplates: "Contact", "Location", and "StatusCode". 在上面,我有三个DisplayTemplates:“Contact”,“Location”和“StatusCode”。 It appears that IIS is loading symbols twice for each time the displaytemplate gets called. 似乎IIS每次调用displaytemplate时都会加载符号两次。