解决VS2008 调试启动特别慢

AI权益加码!Claude Code、Cursor等20+工具免费用! 购周边限时加赠Coding Plan Lite,畅享主流AI工具!学习进阶更高效! 阅读详情

 

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.

Debug

 

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.

Debugging , VSTS

 

 

解决方法:


通过分析发现问题是因为 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.

 

 

VS 2008编译C语言DOS程序的使用教程 Visual Studio 2008 是微软公司推出的一款重要的集成开发环境(IDE),为软件开发者提供了编写代码、调试、测以及发布应用程序的便利环境。它支持包括C++, C#, VB.NET等多种编程语言,并集成了数据库开发工具、服务器配置、版本控制以及与其他微软技术的集成特性。结构体、联合体和枚举是C语言中高级数据类型,允许程序员创建更复杂的数据结构。在DOS环境下使用这些高级数据类型时,需要确保编译器支持相应特性的语法。 阅读详情

相关推荐

Visual Studio 2008 F10单步调试很卡的解决方案

最近接手一个vs2008的老项目,在调试时遇到了不少问题。其中之一,在调试时,我按F10步调时巨卡,一步能卡个好几秒。网上找了很多解决方案,什么设置选项,管理员启动 都无法解决。简直头大。。。 这过程中我发现,在工具栏中按“调试”->"逐过程”。居然一点都不卡,说明设置也好,机器性能也好都是没有问题的。 最终我根据多年的踩坑经验,本能的想到了问题关键-《输入法》。把输入法切换到英文模式,果然问题解决了。 ...

maolingjia的博客 941

VS2008调试单步非常卡解决方法

原因:开启了“在源中显示线程” 解决方法:取消“在源中显示线程” 操作步骤:在调试工具栏中找到,“在源中显示线程”,点击取消。该图标为浅蓝色时,表示开启。 原帖见:http://bbs.csdn.net/topics/390951430

HarmonyFairly 2543

使用VS2008调试问题

使用vs2008进行vc程序的调试,上午没有联网进行的调试,中午使用网络玩了会,下午接着调试,于是出现了按F5后运行极其缓的问题。于是上网找了下,说是从网上加载dll,我晕!断开网络一,耶!果真啊。 上网找了下。网络真TMD是个好东西!!!大家参考下怎样修改: http://www.cnblogs.com/silentmj/archive/2010/04/28/1723109.ht

linghao00的专栏 3537

vs调试特别

原因有很多种,常见的什么设置这里不讲,这里只是记录下,实际使用中的原因之一。 那就是 断点。 尤其是数据断点,调试的过程中它会一直去检查,如果(数据)断点过多,那么会特别卡,尤其是调试的时候。

mincheat的专栏 2285

VS调试卡顿问题汇总,已解决

相信很多朋友都碰到过使用VS进行调试时,进入断点点击继续或者单步时会卡顿一段时间,体验十分不好,经过测我找到了解决方法。

enchanted的博客 1万+

vs2008调试程序时一直在Loading symbols,打开特别

vs2008调试程序时,显示一直在Loading symbols,等上几分钟才能打开程序,本人之前用Windbg调试过程序,按照教程配置过符号加载路径,在环境变量中添加了 _NT_SYMBOL_PATH=srv*c:/mysymbols*http://msdl.microsoft.com/download/symbols,这会导致编译器到上面的地址中去加载符号,导致打开速度很,应将其删除,同时

010 3424

如何在VS2008里面调试DLL?

如何在VS2008里面调试DLL? 1)一个静态库工程(生成lib类型)  编译成功 2)一个正常的win32应用程序(生成exe文件)已经编译好,下面要用到。 以上2个工程在一个解决方案里面,为了调试 然后在lib工程里面设置: Debugging ->Command:输入exe的绝对路径。(你也可以去使用相对路径,没测过) Working Directory : 输入 $(O

MAC 应用开发 861

[VS调试]VS2010 VS2012调试时显示加载符号导致调试特别

打开”调试”–>”选项”看下图: 将那个”勾”去掉确定即可!按下F5调试,瞬间开始了。   如果还有问题,可以VS2010官方论坛上提到的解决方法: You can speed up loading of symbols by doing the following: 1. Verify that you haven’t specified any n

Robin022的专栏 1584

VS 2008和老的VS 2005附件包的兼容性

 【原文地址】VS 2008 Compatibility with Older VS 2005 Add-in Packages 【原文发表日期】 Tuesday, November 27, 2007 11:43 PM 上个星期,我帮几个人解决了他们遇上的VS 2008问题,这些问题包括在启动IDE或者创建新项目时时,程序会死掉,死掉时通常会出现“Visual Studio has enco

roden的专栏 1084

VS2008 按F5调试运行报无法启动程序错误解决方案

这两天遇到个问题,调试vs2008里面的项目时,弹出了个无法启动程序的对话框,开始以为是360和程序冲突的原因,把360都关闭后仍无起作用;也在解决方案里面设置启动项,但是仍没起作用,后来,请教了一位师兄,使用了他提供的方法才能使程序运行起来!真是太妙了! 问题描述: VS2008 按F5调试运行IE报Microsoft Visual Studio无法启动程序“http:...

dasuyan8263的博客 202

安装完VS2008后导致JS调试解决方法

进行过JS开发的人都有这个体会,JS调试是一件很麻烦的事,大家都会找一些调试工具,我用的是微软自带的Microsoft Script Debugger,感觉用起来还是挺方便的。以前机器上装的是Microsoft Visual Studio 6.0,调试JS时感觉特别快。        最近安装了VS2008调试JS突然变的很,感觉挺纳闷的,但我肯定问题是安装VS2008导致的,但问题出在哪里

xiaoniuwangwang的专栏 932

debug : 解决vs2008工程右击不能正常显示工程属性页

故障环境: Win7X64 + vs2008sp1 故障现象: 在vs2008中打开一个已经存在的工程, 右击工程, 选择最下面的"属性", 弹出工程属性页时, 报错, "can't create dotnet property grid", 当时没发邮件自己, 只记得这么多~. 解决措施: 在vs2008命令行运行 devenv /resetskippkgs 故障解决的过程:

博客标题不能为空 5417

VS2008快捷键整理

1. 怎样调整代码排版的格式? 选择:编辑—>高级—>设置文档的格式 或 编辑—>高级—>设置选中代码的格式。 格式化cs代码:Ctrl+k+f 格式化aspx代码:Ctrl+k+d 2. 怎样跳转到指定的某一行? 两种方法:Ⅰ. Ctrl+G Ⅱ. 双击状态栏中的行号 3. 怎样创建矩形选区? 两种方法:Ⅰ. 摁住alt键,然后拖动鼠标即可。 Ⅱ. 按住Shift+Alt点

zzhays的专栏 4142

VS2008远程调试方法

在网上找了好多资料才把这个调试环境搭好,下面总结一下: 先说明两个概念: 1.目标机:远程需要调试的机子,也就是被调试程序exe所在的机子,该机子可以安装VS2008或者不安装vs2008 2.调试机:安装VS2008的机子,就是存放代码下断点调试的机子,该机子必须安装vs2008 下面介绍具体设置步骤: 目标机: 1.如果目标机安装了VS2008则直接在【开始菜】-&gt;【M...

dengbaoleng 174
上一篇: C/C++中回调函数初探
下一篇: try catch throw用法
Gary@Tokyo
博客等级 码龄20年 315粉丝 78原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值