visual-studio Visual Studio 不断崩溃

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

Visual Studio keeps crashing

c#.netvisual-studio

提问by Bob

Visual studio team system 2008 keeps crashing on me. Sometimes it just freezes, or certain parts of the UI get messed up or a weird popup box saying something about unable to load parameters or saying something else about memory or any other number of things.

Visual Studio 团队系统 2008 一直在我身上崩溃。有时它只是死机,或者 UI 的某些部分被搞砸了,或者一个奇怪的弹出框说一些关于无法加载参数的内容,或者说一些关于内存或任何其他数量的事情。

it usually happens when I do a "complex" task like go into debug mode or do a search across of whole solution or run a unit tests or something like that.

它通常发生在我执行“复杂”任务时,例如进入调试模式或搜索整个解决方案或运行单元测试或类似操作。

I rebooted my machine countless time, reinstalled it VS, changed my virtual memory settings, flush my page file on every reboot and anything else i could think of.

我无数次重新启动我的机器,重新安装它,更改我的虚拟内存设置,在每次重新启动时刷新我的页面文件以及我能想到的任何其他事情。

It seems like VS runs out memory or something.

好像 VS 耗尽了内存什么的。

I have a powerfully machine with lots of RAM so that's not the issue

我有一台有很多内存的强大机器,所以这不是问题

any suggestions?

有什么建议?

回答by Dirk Vollmar

You can always try some standard Visual Studio troubleshooting steps:

您始终可以尝试一些标准的 Visual Studio 故障排除步骤:

  • Clean the solution
  • Delete / rename all files in your solution created by VS, i.e. all .ncb, .suo, .user files
  • Launch Visual Studio with all add-ins disabled: devenv.exe /SafeMode
  • Reset All Settings: Tools -> Import / Export Settings -> Reset All Settings
  • Delete HKCU:\Software\Micosoft\VisualStudio\9.0and then restart Visual Studio
  • Repair the Visual Studio installation through Add/Remove Programs
  • 清洁溶液
  • 删除/重命名解决方案中由 VS 创建的所有文件,即所有 .ncb、.suo、.user 文件
  • 在禁用所有加载项的情况下启动 Visual Studio: devenv.exe /SafeMode
  • 重置所有设置:工具 -> 导入/导出设置 -> 重置所有设置
  • 删除HKCU:\Software\Micosoft\VisualStudio\9.0然后重新启动 Visual Studio
  • 通过添加/删除程序修复 Visual Studio 安装

You might also check whether there is a hotfixavailable addressing your issue (e.g. KB960075sounds like a good candidate for you), or whether you find your problem already reported on the Connectwebsite.

您还可以检查是否有可用的修补程序来解决您的问题(例如KB960075听起来很适合您),或者您是否发现Connect网站上已经报告了您的问题。

回答by JaredPar

The first step is to uninstall all 3rd party add-ins on Visual Studio. In particular if you have multiple add-ins as they can interfere with each other in unexpected ways and cause crashes. After uninstalling repeat your scenarios and see if this fixes the issue.

第一步是卸载 Visual Studio 上的所有 3rd 方加载项。特别是如果您有多个加载项,因为它们可能会以意想不到的方式相互干扰并导致崩溃。卸载后重复你的场景,看看这是否能解决问题。

If not then it's best to consult the application log and find out why Visual Studio is crashing. The log will contain at least the error code of the crash which can searched on google or reposted here for us to take a look at.

如果没有,那么最好查阅应用程序日志并找出 Visual Studio 崩溃的原因。日志中至少会包含崩溃的错误代码,可以在谷歌上搜索或转发到这里供我们查看。

回答by locka

Assuming this occurs with VS up to date with all service packs installed, you might try some of these suggestions. If you haven't tried with service packs, do that first.

假设在安装了所有服务包的 VS 最新版本中发生这种情况,您可以尝试其中的一些建议。如果您还没有尝试过使用服务包,请先尝试。

What version of Windows are you using? If it is Windows 7, try launching Visual Studio with a compatibility mode and see if that resolves the issue. To do this, make a copy of the normal launch shortcut and go into the Properties dialog and set it to run as Windows Vista.

您使用的是什么版本的 Windows?如果是 Windows 7,请尝试以兼容模式启动 Visual Studio,看看是否能解决问题。为此,请复制正常启动快捷方式并进入“属性”对话框并将其设置为作为 Windows Vista 运行。

If this doesn't fix it, then you might also consider:

如果这不能解决问题,那么您还可以考虑:

  • Checking your PATH environment for any weird settings which might be confusing it, e.g. paths pointing to other SDKs
  • Any 3rd party VS extensions such as source control, refactoring plugins, wizards etc.
  • Old versions of .NET or SQL server
  • 检查您的 PATH 环境是否有任何可能会混淆它的奇怪设置,例如指向其他 SDK 的路径
  • 任何 3rd 方 VS 扩展,例如源代码控制、重构插件、向导等。
  • .NET 或 SQL 服务器的旧版本

Also test if the issue occurs for every kind of project or just certain kinds, e.g. does it happen for all projects? Does it happen in C++, C#, VB.NET projects etc.

还要测试该问题是针对每种项目还是仅针对某些项目发生,例如是否所有项目都会发生?它是否发生在 C++、C#、VB.NET 项目等中?

回答by Chris O

You can also attach a debugger to Visual Studio, to see what it's doing. Sometimes a particular .sln will trigger bad behavior or more likely, some third-party add-on.

您还可以将调试器附加到 Visual Studio,以查看它在做什么。有时特定的 .sln 会触发不良行为,或者更有可能是某些第三方附加组件。

回答by Hiber

If you believe that you've gotten VS into a wired state, you can try the following command line switches

如果你相信你已经让 VS 进入了有线状态,你可以尝试以下命令行开关

  • devenv.exe /ResetSettings (This will reset the visual studio settings to the defaults)
  • devenv.exe /ResetSettings(这会将 Visual Studio 设置重置为默认值)

If that doesn't help, as a last resort, you can try

如果这没有帮助,作为最后的手段,您可以尝试

  • devenv.exe /ResetUserData
  • devenv.exe /ResetUserData