asp.net-mvc 加载符号时,Visual Studio 调试速度很慢
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17660368/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio debugging painfully slow when loading symbols
提问by Mark Cassar
I have an issue which is practically similar to Visual Studio debugging/loading very slowbut I haven't managed to find a solution to such a problem.
我有一个问题,它实际上类似于Visual Studio 调试/加载非常慢,但我还没有设法找到解决此类问题的方法。
I have tried all what is described within that question and still, the symbol loading for the very first time is drastically slow.
我已经尝试了该问题中描述的所有内容,但第一次加载符号仍然非常缓慢。
Similarly to the other question, when starting an MVC project, I get several lines within the Output panel which consist of something similar to:
与另一个问题类似,在启动 MVC 项目时,我在“输出”面板中看到几行,其中包含类似于以下内容的内容:
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\rootba097f\ab73cbf7\App_Web__headerusermenu.cshtml.ee708ea.myhgafpb.dll', Symbols loaded.
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\rootba097f\ab73cbf7\App_Web__layoutcmsbase.cshtml.ce72eb6d.ovoanhe-.dll', Symbols loaded.
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\rootba097f\ab73cbf7\App_Web__notificationmessage.cshtml.5346933.9aei7ems.dll', Symbols loaded.
Such entries take around 300 - 500 ms each and these are executed for all the Partial Views we have within the project, which are quite considerable.
这些条目每个大约需要 300 - 500 毫秒,并且这些条目是为我们在项目中拥有的所有部分视图执行的,这是相当可观的。
I have tried the solution within the other question but still didn't get any fast response times.
我已经尝试了另一个问题中的解决方案,但仍然没有得到任何快速的响应时间。
These are some tests we have made:
这些是我们进行的一些测试:
Using IIS Express
使用 IIS Express
- Loading website initially takes roughly 2 minutes
- Stopping website and starting again takes around 1 min 45 sec
- Once the website is running, I press on Load All Symbols (Tools > Otions > Debugging > Symbols > Load all symbols) and then stop project and run again, and it takes much less, round 25 sec. Still, the Load All Symbols button is disabled while the project isn't running, so for the very first time, I would need to wait until the project has loaded in order to press Load All Symbols
- 加载网站最初大约需要 2 分钟
- 停止网站并重新启动大约需要 1 分 45 秒
- 网站运行后,我按加载所有符号(工具 > 选项 > 调试 > 符号 > 加载所有符号),然后停止项目并再次运行,它花费的时间要少得多,大约 25 秒。尽管如此,当项目没有运行时,加载所有符号按钮被禁用,所以这是第一次,我需要等到项目加载后才能按加载所有符号
Using Visual Studio Development Server
使用 Visual Studio 开发服务器
- Starting initially, takes roughly 50 sec
- Stopped project and started again, takes roughly 20 sec
- Clicking on Load All Symbols, stopping project and starting again takes roughly 15 sec
- 最初开始,大约需要 50 秒
- 停止项目并重新开始,大约需要 20 秒
- 单击加载所有符号,停止项目并重新启动大约需要 15 秒
This is getting extremely frustrating as it is taking an extremely long amount of time in order to load project for the first time.
这变得非常令人沮丧,因为第一次加载项目需要很长时间。
Any possible solution other than those mentioned within the question Visual Studio debugging/loading very slowwhich might help?
除了问题Visual Studio 调试/加载速度非常慢中提到的那些可能有帮助的解决方案之外,还有其他任何可能的解决方案吗?
回答by MFry
In my case, I had a file open in VS that was not part of my current solution (it happened to be an XML file which I had marked with breakpoints for quick-reference). When I removed those particular breakpoints, the issue resolved.
就我而言,我在 VS 中打开了一个文件,该文件不是我当前解决方案的一部分(它碰巧是一个 XML 文件,我已标记了断点以供快速参考)。当我删除那些特定的断点时,问题就解决了。
回答by unintentionally left blank
As per the comment by rkawano - turning off the Fusion Log can sometimes fix this problem (it did for me). I had enabled the fusion log after reading the following articleand then forgot about it. After some time I started experiencing a significant slowdown of visual studio 2013. The symptom is that VS 2013 becomes unresponsive, particularly when ending a debug session. It will also display symbol loading dialogs when loading a project or stopping the debugger (these are not typically shown).
根据 rkawano 的评论 - 关闭 Fusion Log 有时可以解决这个问题(对我来说确实如此)。我在阅读以下文章后启用了融合日志,然后忘记了它。一段时间后,我开始遇到 Visual Studio 2013 的显着减速。症状是 VS 2013 变得无响应,尤其是在结束调试会话时。它还会在加载项目或停止调试器时显示符号加载对话框(这些通常不会显示)。
回答by Mr. Muh
I had the same issue while hosting my project on a local network share. Moving it to my local System reduced Symbol-Loading times by 90%!
我在本地网络共享上托管我的项目时遇到了同样的问题。将它移动到我的本地系统减少了 90% 的符号加载时间!
回答by Adrian
Have you tried bypassing IIS express and running the application from your local IIS server? The url would look something like this: localhost/{yourprojectname}. You might still have a slow load the first time you hit the application, but after that it should stay pretty snappy because Visual Studio won't be starting the app every time you want to run it. Running the application from your local IIS also allows you to keep Firefox open when you start the debugger instead of opening and closing IE every time.
您是否尝试过绕过 IIS express 并从本地 IIS 服务器运行应用程序?url 看起来像这样:localhost/{yourprojectname}。第一次点击应用程序时,您可能仍然会遇到加载缓慢的情况,但之后它应该会保持非常快速,因为 Visual Studio 不会在您每次想要运行应用程序时都启动它。从本地 IIS 运行应用程序还允许您在启动调试器时保持 Firefox 打开,而不是每次都打开和关闭 IE。
回答by BipinBaglung
Go to Tools>Options>Environment>Add In Security Uncheck "allow add in components to load" Restart Visual Studio
转到工具>选项>环境>添加安全性取消选中“允许添加组件加载”重新启动Visual Studio
回答by Craig Simon
I had the same slow-loading issue, but it was plaguing only one sandbox solution. Very similar staging and production/copy solutions were working just fine. So all these environmental tweaks folks were recommending couldn't explain it (I tried them anyway, of course.) Then I compared the .csproj files and found a suspicious looking difference. After correcting that, things got back to normal.
我遇到了同样的加载缓慢问题,但它只困扰着一个沙箱解决方案。非常相似的登台和生产/复制解决方案工作得很好。所以人们推荐的所有这些环境调整都无法解释它(当然我还是尝试了它们。)然后我比较了 .csproj 文件,发现了一个可疑的外观差异。改正之后,一切又恢复了正常。
回答by cgatian
I tried all solutions and nothing seemed to work. I cracked open my symbol settings TOOLS > Options > Debugging > Symbolsand found the Cache Symbols in this directoryset to another user's directory e.g. C:\Users\<not my name>\AppData\Local\Temp\SymbolCache
我尝试了所有解决方案,但似乎没有任何效果。我破解了我的符号设置工具>选项>调试>符号并找到了Cache Symbols in this directory另一个用户的目录,例如C:\Users\<not my name>\AppData\Local\Temp\SymbolCache
I then cleared the setting string by making it empty, and removed any other pdb locations configured. Then press OK.
然后我通过将其设置为空来清除设置字符串,并删除配置的任何其他 pdb 位置。然后按确定。
Then I kicked off a build and allowed VS to resolve those symbols (20 sec). I then stopped and restarted, and launched without loading symbols.
然后我开始构建并允许 VS 解析这些符号(20 秒)。然后我停止并重新启动,并在没有加载符号的情况下启动。
I'm assuming somewhere down the line I imported settings from another user.
我假设我从另一个用户导入了设置。
回答by crb42
My VS2013 was painfully slow when debugging due to slow loading symbols. I noticed, during the slow loading, my network usage was very high though my app does not access it.
由于加载符号缓慢,我的 VS2013 在调试时非常缓慢。我注意到,在缓慢加载期间,我的网络使用率非常高,但我的应用程序无法访问它。
As an experiment, I unplugged my Ethernet cable and debugging was very fast. My symbols DownstreamStore was located at C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\DownstreamStore. Under Tools\Debugging\Symbols, I cleared the cache and when I attempted to exit, I received a message that it required administrator privileges to continue.
作为一项实验,我拔掉了以太网电缆,调试速度非常快。我的符号 DownstreamStore 位于 C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\DownstreamStore。在 Tools\Debugging\Symbols 下,我清除了缓存,当我尝试退出时,我收到一条消息,提示它需要管理员权限才能继续。
It may have been the permissions (that have probably changed since 2013) that was causing the symbols to be loaded from the Internet. I changed the directory to another, nonadministrative location on my flash drive and debugged. It was very slow the first time, but thereafter, it is was very fast.
可能是权限(自 2013 年以来可能已更改)导致符号从 Internet 加载。我将目录更改为闪存驱动器上的另一个非管理位置并进行了调试。第一次很慢,但后来就很快了。


