visual-studio Visual Studio 在打开项目时冻结
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1710408/
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 Freezing On Opening Project
提问by kevin
My Visual Studio seems to be freezing/lagging when I open a existing project. I have added NHibernate framework into my code and it seems to lag my computer (at least that's what I think). When I open other projects, I do not lag or freeze at all. The freeze is about 3- seconds to a minute, then it will open my project and it will just act very slowly, it might take 20+ seconds just to switch classes an 20+ more seconds just to type a single character into visual studios.
当我打开现有项目时,我的 Visual Studio 似乎冻结/滞后。我已将 NHibernate 框架添加到我的代码中,但它似乎滞后于我的计算机(至少我是这么认为的)。当我打开其他项目时,我根本不会滞后或冻结。冻结大约是 3 秒到一分钟,然后它会打开我的项目,它的动作会非常缓慢,可能需要 20 多秒才能切换课程,而在视觉工作室中输入一个字符可能需要 20 多秒。
I was wondering if anyone has had this problem before. If so how did you fix it?
我想知道以前是否有人遇到过这个问题。如果是这样,你是如何解决的?
I can't really work on my code until this is fixed. Oh also, when is save the code, it freezes for a good minute or two also.
在修复此问题之前,我无法真正处理我的代码。哦还有,什么时候保存代码,它也会冻结一两分钟。
回答by Kirill Osenkov
You can see exactly what VS is doing at any given moment, if you attach a debugger to the devenv.exe process and hit Break when it hangs. Then load the symbols from Microsoft Symbols server and show the call stack for the VS main thread.
如果您将调试器附加到 devenv.exe 进程并在它挂起时点击 Break,您可以准确地看到 VS 在任何给定时刻正在做什么。然后从 Microsoft Symbols 服务器加载符号并显示 VS 主线程的调用堆栈。
I wrote a very detailed article about how to debug crashes and hangs here: http://blogs.msdn.com/kirillosenkov/archive/2008/12/07/how-to-debug-crashes-and-hangs.aspx
我在这里写了一篇关于如何调试崩溃和挂起的非常详细的文章:http: //blogs.msdn.com/kirillosenkov/archive/2008/12/07/how-to-debug-crashes-and-hangs.aspx
From the call stack it should be obvious what is causing the delay.
从调用堆栈应该很明显是什么导致了延迟。
回答by Chris Moschini
Had the same problem. Closed Visual Studio 2010, opened again Running as Administrator, went to Extension Manager, uninstalled Nuget Package Manager, restarted Visual Studio 2010 running as regular user, opened problem solution, solution opened fine.
有同样的问题。关闭 Visual Studio 2010,再次打开以管理员身份运行,进入扩展管理器,卸载 Nuget 包管理器,重新启动以普通用户身份运行的 Visual Studio 2010,打开问题解决方案,解决方案打开正常。
Nuget Package Manager seems to be the cause. My problem solution is using EF 4.3 Code First which interacts heavily with the Package Manager Console, but that may just be a coincidence.
Nuget 包管理器似乎是原因。我的问题解决方案是使用 EF 4.3 Code First,它与包管理器控制台进行了大量交互,但这可能只是巧合。
回答by user3193904
For me, removing the suo file (from the v14 sub directory) solved the problem...
对我来说,删除 suo 文件(从 v14 子目录中)解决了这个问题......
回答by Gary DeReese
I had a hunch that something had been corrupted with one of my NuGet packages, and completely deleted the \packagessubfolder and its contents. When I reopened the solution, all projects loaded successfully without hanging.
我有一种预感,我的一个 NuGet 包已经损坏了某些东西,并完全删除了\packages子文件夹及其内容。当我重新打开解决方案时,所有项目都成功加载而没有挂起。
From there, I restored the previously deleted packages from the NuGet Package Manager Console and I was back up and running.
从那里,我从 NuGet 包管理器控制台恢复了之前删除的包,然后我就恢复了运行。
回答by Ido Ran
As answer by Visual Studio 2015 Freezing White Loading Solutiondelete the .vshidden directory solved the issue for me.
作为Visual Studio 2015 Freezing White Loading Solution 的回答,删除.vs隐藏目录为我解决了这个问题。
I am using Visual Studio 2017 Community Edition.
我正在使用 Visual Studio 2017 社区版。
回答by bytebender
What, if any Add-ins do you have installed?
什么,如果您安装了任何加载项?
Edit:
编辑:
One suggestion I would have then is to systematically disable each of your add-ins and see if performance changes and if it does research the culprit and see if there any updates available.
我的一个建议是系统地禁用每个加载项,看看性能是否发生变化,是否确实研究了罪魁祸首,看看是否有可用的更新。
回答by leppie
Uninstall any MS Enterprise Framework addin's you may have.
卸载您可能拥有的任何 MS Enterprise Framework 插件。
Delete the VS temp directory (and the Windows one).
删除 VS 临时目录(和 Windows 目录)。
Do you use TFS? Perhaps the server is a bit sleepy, that will make it freeze for a few minutes, but is ok afterwards.
你使用 TFS 吗?也许服务器有点困,这会使其冻结几分钟,但之后就可以了。
回答by Vijay Nerkar
I had same problem. Delete following folder. C:\Users\UserName\AppData\Local\Microsoft\VisualStudio
我有同样的问题。删除以下文件夹。C:\Users\UserName\AppData\Local\Microsoft\VisualStudio
回答by danyim
For me, a chkdsk /F /R(which will prompt you to restart) and about 30 minutes of company time fixed this issue.
对我来说,一个chkdsk /F /R(它会提示你重新启动)和大约 30 分钟的公司时间解决了这个问题。
I think a few improperly closed instances of Visual Studio may have attributed to the issue.
我认为一些不正确关闭的 Visual Studio 实例可能归因于这个问题。
回答by Brent
My local files somehow became corrupted for one project, fortunately I didn't have any pending changes so rather than run chkdsk I just deleted the folder and checked out the solution from source control again.
我的本地文件不知何故损坏了一个项目,幸运的是我没有任何待处理的更改,所以我没有运行 chkdsk 我只是删除了该文件夹并再次从源代码管理中检出解决方案。

