visual-studio 切换到调试模式时 Visual Studio 冻结
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1835026/
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 freezes when switching to debug mode
提问by cvb
Strange Visual Studio (TS 2008) problem: The IDE completely freezes whenever I switch from Release to Debug mode in a specific project. It happens right as I switch, before I try to build or do anything else.
奇怪的 Visual Studio (TS 2008) 问题:每当我在特定项目中从发布模式切换到调试模式时,IDE 完全冻结。它发生在我切换时,在我尝试构建或做任何其他事情之前。
The whole thing started out of the blue, without any abnormal change I can think of. I tried to clean the solution, but it didn't help.
整个事情都是突然开始的,没有任何我能想到的异常变化。我试图清理解决方案,但没有帮助。
Anyone ran into this before?
以前有人遇到过这个吗?
回答by Anton K
If everything has worked fine and then stopped, usually it means there was some problem even though it had passed unnoticed.
如果一切正常然后停止,通常这意味着存在一些问题,即使它被忽视了。
Things I would try one after another:
我会一一尝试的事情:
- Check which files were changed (why and how) after update from a source control engine
- Review the list of extensions and plugins. Try to disable all or some of them
- Close Visual Studio and kill all the development processes:
devenv, mspdbsrv, vcpkgsrv, msbuild, msvsmon, vshub, vstestetc - Remove
.suo, .ncb, .VC.db, .VC.VC.opendbfiles of the solution as well as.vsdirectory, which sometimes cause problems - Remove project setting files, sort of
YourProjectName.vcproj.DOMAINNAME.LOGINNAME.userorYourProjectName.csproj.user. The setting file name depends on a project kind you use - Run
"C:\Program Files\Microsoft Visual Studio [vs_version]\Common7\IDE\devenv.exe" /setupor"C:\Program Files (x86)\Microsoft Visual Studio [vs_version]\Common7\IDE\devenv.exe" /setupfor x64 environment - In some complex cases, it helps to remove user settings, located in home
%USERPROFILE%\AppData\[Local|Roaming]\Microsoft\VisualStudio[vs_version]and in registryHKCU\SOFTWARE\Microsoft\VisualStudio[vs_version]
- 检查从源控制引擎更新后哪些文件被更改(为什么以及如何)
- 查看扩展和插件列表。尝试禁用全部或部分
- 关闭 Visual Studio 并终止所有开发进程:
devenv, mspdbsrv, vcpkgsrv, msbuild, msvsmon, vshub, vstest等 - 删除
.suo, .ncb, .VC.db, .VC.VC.opendb解决方案的文件以及.vs目录,这有时会导致问题 - 删除项目设置文件,
YourProjectName.vcproj.DOMAINNAME.LOGINNAME.user或YourProjectName.csproj.user. 设置文件名取决于您使用的项目类型 - 运行
"C:\Program Files\Microsoft Visual Studio [vs_version]\Common7\IDE\devenv.exe" /setup或"C:\Program Files (x86)\Microsoft Visual Studio [vs_version]\Common7\IDE\devenv.exe" /setup用于 x64 环境 - 在一些复杂的情况下,它有助于删除位于主页
%USERPROFILE%\AppData\[Local|Roaming]\Microsoft\VisualStudio[vs_version]和注册表中的用户设置HKCU\SOFTWARE\Microsoft\VisualStudio[vs_version]
It should reset all things to the beginning state. If it won't work, so there are additional tools to investigate. Download Process Explorerand once IDE freezes, start the Process Explorer, find the devenv process, double-click on it and go to Threads tab. Check, which thread has the biggest switch delta in case of the freeze, double-click on it and take the name (or offset) of the top function. It gives additional info where the problem may be.
它应该将所有内容重置为开始状态。如果它不起作用,那么还有其他工具可以进行调查。下载Process Explorer,一旦 IDE 冻结,启动 Process Explorer,找到 devenv 进程,双击它并转到 Threads 选项卡。检查在冻结的情况下哪个线程具有最大的开关增量,双击它并获取顶部函数的名称(或偏移量)。它提供了可能出现问题的附加信息。
Moreover, sometimes it helps to repair Visual Studio in the "Add or Remove Programs" wizard in Control Panel.
此外,有时它有助于在控制面板的“添加或删除程序”向导中修复 Visual Studio。
回答by Michael
Had this problem in 2017. I ran VS 2017 as Administrator and it worked.
在 2017 年遇到了这个问题。我以管理员身份运行 VS 2017 并且它工作正常。
回答by Raf
I've encountered this in VS 2017 (15.8). Upgrade to the newest version (15.9 at that time) resolved the issue.
我在 VS 2017 (15.8) 中遇到过这个问题。升级到最新版本(当时是 15.9)解决了这个问题。

