解决VS2008 调试启动特别慢
Resolving Very Slow Symbol Loading with VS 2008 during debugging
Recently, I was encountering insanely slow project loading times during debugging in Visual Studio 2008. Interestingly, this only happened while loading the project only in debug mode. Also, during the slow symbol loading time, the status bar at Visual Studio 2008 always showed Loading Symbols For ____.Dll .
To track it down, I enabled logging for the VS 2008 IDE. This can be done by adding the following entries to its configuration file.
1) Navigate to: C:/Program Files/Microsoft Visual Studio 9.0/Common7/IDE in Windows Explorer
2) Load devenv.exe.config in text editor.
3) Add the following entries into it
<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="myListener"
type="System.Diagnostics.TextWriterTraceListener, System version=1.0.3300.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089"
initializeData="c:/myListener.log" />
<remove name="Default" />
</listeners>
</trace>
</system.diagnostics>
As per this configuration, the trace log would be saved to C:/myListener.Log. Now I fired up VS 2008 and loaded to project in debug mode to reproduce the issues.
I also ran couple of unit test cases in debug mode which were also not able to load. I opened the trace log and found these exceptions:
[V, 5820, 7, 2008/07/04 14:00:33.412] devenv.exe: DIA thew in retrieving symbols: System.Runtime.InteropServices.COMException (0x806D0005): Exception from HRESULT: 0x806D0005
at Microsoft.VisualStudio.TestTools.Common.Dia2Lib.IDiaDataSource.loadDataForExe(String executable, String searchPath, Object pCallback)
at Microsoft.VisualStudio.TestTools.Common.DiaHelper.GetSymbolsFileName(String imagePath)
Confirmed with the issue was related to loading of Symbols. I realized that I had once set up a dedicated symbol directory on machine at C:/symbols to enable debugging with WinDbg.
I checked the Debugging Options in VS 2008 to see if its trying to load symbols from somewhere else.

Then suddenly, I was reminded that I had once set up a environment variable _NT_SYMBOL_PATH to an Internet location while debugging in WinDbg to enable automatic downloading of symbols.
I originally thought that this setting was only applicable to WinDbg. But I was mistaken. In fact, this setting will be used across by all debuggers (atleast Microsoft debuggers). This is documented here. I was pretty sure that VS 2008 was trying to load symbols from the Internet location and since many of the assemblies in my application didn't had symbols were them, it must have been failing.
To confirm, I fired My Computer -> Properties -> Advanced -> Environment Variables and cleared out the line
_NT_SYMBOL_PATH=srv*c:/mysymbols*http://msdl.microsoft.com/download/symbols;cache*c:/mysymbols
I reloaded the my project in VS 2008 in debug mode and Bingo, the problem was solved :)
While investigating this problem, I came across many other sources which could cause this issue , so I thought I can post it here for the benefit of community. The credit for these tips goes to Azeem Khan who is working with VSTS team at Microsoft.
- Make sure that you don't have a symbol path specified in VS under Tools | Options | Debugging | Symbols and also, that you don't have the NT_SYMBOL_PATH environment variable set on your machine.
- Verify that you haven't specified any network shares under the same setting to server that do not exist anymore. This will require timeouts.
- Specify a local cache for symbols under the same setting. After you have downloaded symbols once from network shares you can disable those locations. Symbol loading will go a lot faster after the first attempt.
- Do not specify any symbol lookup paths at all either in environment variable and specify paths in the options page but specify that they be used for manual loading. You can then manually load symbols for modules you care about either via the context menu in call stack or the modules window.
- VS 2008 SP1 has made a few improvements in this area. It allows for canceling loading of symbols as it is happening. This will allow you to get to your debug session much faster. Note that this is currently in Beta.
- Clearing the breakpoints also serve to solve this problem for some people.
解决方法:
通过分析发现问题是因为 Load Symbol 过慢造成的
将环境变量中的:
_NT_SYMBOL_PATH=srv*c:/mysymbols*http://msdl.microsoft.com/download/symbols;cache*c:/mysymbols
键删除,并重新启动 VS2008 即可,因为此键的存在会使 VS2008 到此键中标记的地址去下载 Symbol ,而造成调试启动的极度下降。
我的情况:
通过查找,在环境变量中没有看到_NT_SYMBOL_PATH ,设置SYMBOL的字眼都没有。通过搜索,在C:/WINDOWS/Symbols看到有个DLL的文件夹,里面全部是pdb文件。将dll文件夹改名(因为对这些文件的用途不大了解,删除是不可恢复,所以改名避免删除导致其他错误 ),然后重启VS2008就OK.
解决VS2008 调试启动特别慢的更多相关文章
- VS2010 调试启动特别慢
调试选项里有 _NT_SYMBOL_PATH 这一项,并且不能取消选择.只好删除这个环境变量,此来源于windbg环境中需要.重启windows后,VS2010调试里已没有此项,F5调试飞快--
- VS2008调试技巧收集备用
VS2005调试技巧集合 http://blog.csdn.net/rainylin/archive/2007/09/06/1775125.aspx 下面有从浅入深的6个问题,您可以尝试回答一下 一个 ...
- VS调试 启动vs报错--未启动IIS
VS调试 启动程序报错——未启动IIS Express Web服务 解决办法: 1.关闭VS. 2.删出项目文件下的".vs"文件. 3.重新启动解决方案. 4.编译,运行OK. ...
- 关于加了hibernate 框架的项目启动特别慢的问题
今天突然遇到一个问题,就是加了hibernate 框架的项目在启动的时候,特别慢,竟然达到了4分多钟,查来查去,看到我的bean类里*.hbm.xml,有这样的写法: <?xml version ...
- 解决 Virtual Box 启动 Cannot load R0 module supLoadModule returned VERR_LDR_MISMATCH_NATIVE Failed to register ourselves as a PCI Bus (VERR_MODULE_NOT_FOUND)
返回 代码:E_FAIL (0x80004005)组件:Console界面:IConsole {8ab7c520-2442-4b66-8d74-4ff1e195d2b6} 原因: 我新建了一个vdi文 ...
- 替换系统数据库解决SQLSERVER服务启动不了的问题
替换系统数据库解决SQLSERVER服务启动不了的问题 当遇到SQLSERVER服务启动不起来的时候,我们试过把系统的四个数据库master ,model ,tempdb,msdb 替换掉,Windo ...
- 如何使VS2008 调试网站的根目录和IIS调试的一致?
用VS2008做asp.net网站调试时,经常会多出来一个目录,如http://localhost:1234/Foo/ , 由于一些图片的路径问题,我们不需要最后的/Foo/目录,而是像IIS调试那样 ...
- 解决IIS无法启动w3svc
1>:首先在CMD命令行中输入:fsutil resource setautoreset true c:\ 2>:然后在运行services.msc 3>:找到Windows Pro ...
- 【转】解决keepalived正常启动但是虚IP(VIP)没有生成的问题
如题所示,keepalived安装配置好之后能够正常启动,但是虚IP并没有生成.接着检查防火墙(iptables)发现也没有相关的限制.稍微郁闷了一下之后,查看了keepalived日志文件,这次成功 ...
随机推荐
- 织梦DedeCMS实现 三级栏目_二级栏目_一级栏目_网站名称 的效果代码
1.将官方原来的排列方式反过来,找到include/typelink.class.php第164行 $this->valuePositionName = $tinfos['typename']. ...
- 给定字符串数组,用map的key保存数组中字符串元素,value保存字符串元素出现次数,最后统计个字符串元素出现次数
import java.util.HashMap; public class map1 { public static void main(String[] args) { String[] arra ...
- d3.js学习笔记(五)——将数据结构化为D3.js可处理的
目标 在这一章,你将会理解如何对数据进行结构化,来更好的使用D3.js. 我们将会回顾我们之前已经学习的,学习D3.js如何使用选集(selections),JavaScript对象基础,以及如何最优 ...
- zzuli 2172 队列优化dp
2172: GJJ的日常之购物 Time Limit: 3 Sec Memory Limit: 128 MBSubmit: 9 Solved: 8 SubmitStatusWeb Board De ...
- 【第13届景驰-埃森哲杯广东工业大学ACM程序设计大赛-F】等式(因子个数)
题目描述 给定n,求1/x + 1/y = 1/n (x<=y)的解数.(x.y.n均为正整数) 输入描述: 在第一行输入一个正整数T.接下来有T行,每行输入一个正整数n,请求出符合该方程要求的 ...
- LeetCode OJ:Divide Two Integers(两数相除)
Divide two integers without using multiplication, division and mod operator. If it is overflow, retu ...
- 剑指offer--26.顺时针打印矩阵
1,2,3,45,6,7,88,10,11,1213,14,15,16 每次输出第一行,然后删除第一行,逆时针旋转剩下的矩阵. ------------------------------------ ...
- Unity在协程(Coroutines)内开启线程(Threading )
孙广东 2017.6.13 http://blog.csdn.NET/u010019717 为什么要在协程中开启线程, 因为很多时候我们是需要线程执行完成后回到主线程的.然后主线程在继续执行后续的操 ...
- [置顶]
Android RadioButton与TextView浪漫约会?
情景一 今天主要实现一个国家与地区切换,就是当我们选中RadioButton时然后将值设置到TextView中,听着这需求应该不难对吧?那么我们就开始约会吧? 看下原型图 准备条件: 首先需要一个ra ...
- 预热篇- 总结Delphi Xe4 做App的的可行性分析. ios平台的问题还需要自行学习
首先澄清一个问题, 很多同学其实是误会了, 以为只要搞定了Delphi 就能很快写快餐程序了. ios 本身的知识还是需要一些的, 并没有什么捷径可以走. 但如果一个团队有分工协作的话, Delph ...