visual-studio Visual Studio 加载符号

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3377720/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 12:17:47  来源:igfitidea点击:

Visual Studio loading symbols

visual-studiodebuggingdebug-symbols

提问by arnoldino

I'm working on a ColdFusionproject for a while now, and Visual Studio started to behave strange for me at least.

我在ColdFusion项目上工作了一段时间,Visual Studio 至少对我来说开始表现得很奇怪。

I observed that when I started debugging, it built the project, it started the deploy, and the deploy finished and it was starting to load symbols for my project.

我观察到,当我开始调试时,它会构建项目,开始部署,然后部署完成并开始为我的项目加载符号。

But it was very slow, and I don't know why it started to do this step. What may I have done?

但是很慢,不知道为什么开始做这一步。我可能做了什么?

Is this symbol loading step necessary? How can I disable it?

这个符号加载步骤是否必要?我怎样才能禁用它?

In the Tools -> Options -> Debugging -> Symbols dialog there is no Symbol file (.pdb) location added. And I pointed in my project's debug directory at the field below, and I checked the "Search the above directory only when symbols are ...." checkbox. How should I set up this dialog to turn off symbol loading?

在工具 -> 选项 -> 调试 -> 符号对话框中,没有添加符号文件 (.pdb) 位置。我在我的项目调试目录中指向下面的字段,并选中了“仅当符号为 .... 时才搜索上面的目录”复选框。我应该如何设置这个对话框来关闭符号加载?

I looked in the Modules window which symbols are loaded, but it says nothing to me. What is the problem?

我查看了加载了哪些符号的模块窗口,但它对我没有任何说明。问题是什么?

enter image description here

在此处输入图片说明

回答by peterfoldi

Debug -> Delete All Breakpoints ( http://darrinbishop.com/blog/2010/06/sharepoint-2010-hangs-after-visual-studio-2010-f5-debugging) After that you can use them again, but do it once. It will remove some kind of "invalid" breakpoints too and then loading symbols will be fast again. I was chasing this issue for days :(.

Debug -> Delete All Breakpoints ( http://darrinbishop.com/blog/2010/06/sharepoint-2010-hangs-after-visual-studio-2010-f5-debugging) 之后你可以再次使用它们,但是这样做一次。它也会删除某种“无效”断点,然后加载符号将再次快速。我追这个问题好几天了:(。

回答by nietras

Another reason for slow loading is if you have disabled "Enable Just My Code" in Debugging options. To enable this go to:

加载缓慢的另一个原因是您在调试选项中禁用了“仅启用我的代码”。要启用此功能,请转到:

Tools -> Options -> Debugging -> General -> Enable Just My Code (Managed Only) 

Make sure this is checked.

确保选中此项。

回答by Rup

Configure in Tools, Options, Debugging, Symbols.

在工具、选项、调试、符号中配置。

You can watch the output window (view, output) to see what it's doing usually. If it's really slow that probably means it's hitting a symbol server, probably Microsoft's, to download missing symbols. This takes three HTTP hits for each file it can't find on every startup - you can sometimes see this in the status bar at the bottom or in e.g. Fiddler. You can see which modules have loaded symbols in Debug, Windows, Modules whilst you're debugging.

您可以查看输出窗口(查看、输出)以查看它通常在做什么。如果它真的很慢,那可能意味着它正在访问一个符号服务器,可能是微软的,下载丢失的符号。对于在每次启动时无法找到的每个文件,这需要三个 HTTP 命中 - 您有时可以在底部的状态栏中或例如 Fiddler 中看到这一点。您可以在调试时查看哪些模块在 Debug、Windows、Modules 中加载了符号。

Symbols mean you get useful stack trace information into third party and system assemblies. You definitely need them for your own code, but I think those get loaded regardless. Your best bet is to turn off any non-local symbol sources in that menu and, if you're loading lots of symbols for system assemblies that you don't need to debug into you can temporarily disable loading those to speed up debug start - but they're often useful to have loaded.

符号意味着您可以在第三方和系统程序集中获得有用的堆栈跟踪信息。您肯定需要将它们用于您自己的代码,但我认为无论如何都会加载它们。最好的办法是关闭该菜单中的任何非本地符号源,如果您正在为不需要调试的系统程序集加载大量符号,则可以暂时禁用加载这些符号以加快调试启动 -但是加载它们通常很有用。

回答by JohnMcC

Just had this problem.

刚遇到这个问题。

I fixed it by navigating to:

我通过导航到:

Tools-> Options-> Debugging-> Symbols

工具->选项->调试->符号

Then unchecking all non-local sources for Symbol file (.pdb) locations

然后取消选中符号文件 (.pdb) 位置的所有非本地源

e.g. Microsoft Symbol Serversand msdl.microsoft.com/download/symbols

例如Microsoft 符号服务器msdl.microsoft.com/download/symbols

回答by jcarle

I faced a similar problem. In my case I had set _NT_SYMBOL_PATH to download from Microsoft Servers for use in WinDbg and it looks like when set, Visual Studio will use that with no way to ignore it. Removing that environment variable resolved my issue.

我遇到了类似的问题。就我而言,我已将 _NT_SYMBOL_PATH 设置为从 Microsoft 服务器下载以在 WinDbg 中使用,并且看起来设置后,Visual Studio 将使用它而无法忽略它。删除该环境变量解决了我的问题。

回答by H'H

reference: social.msdn.microsoft.com

参考:social.msdn.microsoft.com

with above ref., I found this solution which is somehow summary of above answers.

通过上面的参考,我找到了这个解决方案,它以某种方式总结了上述答案。

  1. Go to Tools -> Options -> Debugging -> General

  2. CHECK the checkmark next to "Enable Just My Code".

  3. Go to Tools -> Options -> Debugging -> Symbols

  4. Click on the "..." button and create/select a new folder somewhere on your local computer to store cached symbols. I named mine "Symbol caching" and put it in Documents -> Visual Studio 2012.

  5. Click on "Load all symbols" and wait for the symbols to be downloaded from Microsoft's servers, which may take a while. Note that Load all symbols button is only available while debugging.

  6. UNCHECK the checkmark next to "Microsoft Symbol Servers" to prevent Visual Studio from remotely querying the Microsoft servers.

  7. Click "OK".

  1. 转到工具 -> 选项 -> 调试 -> 常规

  2. 选中“仅启用我的代码”旁边的复选标记。

  3. 转到工具 -> 选项 -> 调试 -> 符号

  4. 单击“...”按钮并在本地计算机上的某处创建/选择一个新文件夹来存储缓存符号。我将我的命名为“符号缓存”并将其放在文档 -> Visual Studio 2012 中。

  5. 单击“加载所有符号”并等待符号从 Microsoft 的服务器下载,这可能需要一段时间。请注意,加载所有符号按钮仅在调试时可用。

  6. 取消选中“Microsoft 符号服务器”旁边的复选标记以防止 Visual Studio 远程查询 Microsoft 服务器。

  7. 单击“确定”。

Also try to delete all the breakpoints(Debug>Delete all the breakpoints),

也尝试删除所有断点(Debug>Delete all the breakpoints),

回答by Cameron

For me, it seems related to breakpoints, as indicated in the accepted answer. However, I found two workarounds that did not involve deleting all the breakpoints:

对我来说,它似乎与断点有关,如已接受的答案所示。但是,我发现了两种不涉及删除所有断点的解决方法:

  • Restarting Visual Studio seemed to fix it temporarily.
  • Clicking the "X" button to close Visual Studio while debugging causes the "Do you want to stop debugging?" message box to pop up; while this message box is up, the symbols load at ordinary speeds. Once all the symbols are loaded, you can click "No" to cancel the close.
  • 重新启动 Visual Studio 似乎可以暂时修复它。
  • 在调试时单击“X”按钮关闭 Visual Studio 会导致“您想停止调试吗?” 弹出消息框;当这个消息框出现时,符号以普通速度加载。加载所有符号后,您可以单击“否”取消关闭。

回答by SteveL

Just encountered this issue. Deleting breakpoints didn't work, or at least not just on its own. After this failed I Went Tools > Options > Debugging > Symbols and "Empty Symbol Cache"

刚遇到这个问题。删除断点没有用,或者至少不能单独使用。失败后,我去了工具>选项>调试>符号和“空符号缓存”

and then cleaned the solution and rebuilt.

然后清洗溶液并重建。

Now seems to be working correctly. So if you try all the other things listed, and it still makes no differnce, these additional bits of info may help...

现在似乎工作正常。因此,如果您尝试列出的所有其他内容,但仍然没有任何区别,那么这些额外的信息可能会有所帮助...

回答by twoflower

I had the same problem and even after turning the symbol loading off, the module loading in Visual Studio was terribly slow.

我遇到了同样的问题,即使在关闭符号加载后,Visual Studio 中的模块加载也非常缓慢。

The solution was to turn off the antivirus software (in my case NOD32) or better yet, to add exceptions to it so that it ignores the paths from which your process is loading assemblies (in my case it is the GAC folder and the Temporary ASP.NET Files folder).

解决方案是关闭防病毒软件(在我的情况下为 NOD32)或更好的是,为其添加例外,以便它忽略您的进程加载程序集的路径(在我的情况下是 GAC 文件夹和临时 ASP .NET 文件文件夹)。

回答by user3374479

My 2 cents,

我的 2 美分,

I was having a similar problem while trying to get a (Visual Studio 2013) Diagnostics Report in x64 Release Mode (CPU Sampling) and while the symbols for the needed dll files were loaded, the symbols for my executable would fail to load.

我在尝试以 x64 发布模式(CPU 采样)获取(Visual Studio 2013)诊断报告时遇到了类似的问题,并且在加载了所需 dll 文件的符号时,我的可执行文件的符号将无法加载。

I didn't change anything in the Symbols menu, I instead made some changes within the Property Pages of my executable's thread in the Solution Explorer, namely

我没有更改符号菜单中的任何内容,而是在解决方案资源管理器中可执行文件线程的属性页中进行了一些更改,即

Configuration Properties / General / Enable Managed Incremental Build to YES

配置属性/常规/启用托管增量构建为 YES

Configuration Properties / Debugging / Merge Environment to NO

配置属性/调试/合并环境为NO

Configuration Properties / C/C++ / Enable Browse Information to YES (/FR)

配置属性 / C/C++ / 启用浏览信息为 YES (/FR)

Configuration Properties / Linker / Enable Incremental Linking to YES (/INCREMENTAL)

配置属性/链接器/启用增量链接到 YES (/INCREMENTAL)

EDIT : This last one does the trick

编辑:最后一个可以解决问题

....

....

Configuration Properties / Linker / Debugging / Generate Debug Info to Yes (/DEBUG)

配置属性/链接器/调试/生成调试信息为是 (/DEBUG)

....

....

After that it worked and it loaded the symbols fine. I'm sure one or more of the above did the trick for me (although I'm not sure exactly which) and just want to let others know and try this..

之后它工作了并且它很好地加载了符号。我确定上面的一个或多个对我有用(虽然我不确定到底是哪个),只是想让其他人知道并尝试这个..

peace

和平