Visual Studio 2015 年崩溃

Visual Studio 2015 crashes

Visual studio 不会修复...
每次我想在 vs 2015 上编译应用程序时,它都会崩溃。即使我想编译主函数或向其写入一些东西,也会出现一个 window,上面写着

Visual Studio 2015 has stopped working

2013 Express 版本也是如此。 我知道为什么它不起作用:当我打开团队资源管理器时,出现错误:

Page '3185ed96-1cbd-4381-a439-636973542e50' not found.

我尝试了我在互联网上找到的一切,相信我 - 没有任何效果。 我还尝试了一些命令提示符命令:

devenv.exe/ debug  
devenv.exe/ resetsettings  
devenv.exe/ instalvstemplates  
devenv.exe/ resetskippings  
devenv.exe/ resetuserdata  
devenv.exe/ setup  
devenv.exe/ safemode  

调试模式给了我一些关于错误的信息:

'System.InvalidOperationException' 类型的未处理异常发生在 mscorlib.dll

附加信息:必须安装服务“Microsoft.Internal.VisualStudio.Shell.Interop.SVsUIThreadInvokerPrivate”才能使用此功能。确保此服务可用。 HRESULT = 0x80004002

构造此框架的内容时遇到异常。此信息也记录在 "C:\Users\admin\AppData\Roaming\Microsoft\VisualStudio.0\ActivityLog.xml".

Exception details:
System.ArgumentException: Parametr is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, UInt32 flags)
   at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, ProvideToolWindowAttribute tool)
   at Microsoft.VisualStudio.Shell.Package.FindToolWindow(Type toolWindowType, Int32 id, Boolean create, ProvideToolWindowAttribute tool)
   at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Guid& toolWindowType, Int32 id)
   at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsToolWindowFactory.CreateToolWindow(Guid& toolWindowType, UInt32 id)
   at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()

但我仍然找不到任何有用的东西。

我重新安装了 VS 并修复了它 - 仍然没有。 然后我下载了一些 .dll、microsoft visual c++ 可再发行组件包并使用 Ccleaner 清理注册表。 我认为这是一个非常奇怪的错误;如果你能告诉我一个修复方法好吗?

可能修复这些类型错误:

尝试更新设备驱动程序(Intel HD Graphics)或 运行 如果您使用的是基于交换机的图形驱动程序,反之亦然。

主要可执行文件位于

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe

此外,如果您在安装 exe 时遇到这些类型错误,您可以用同样的方法修复它

取消选中[工具->选项->环境->根据客户端性能自动调整视觉体验]

取消选中[如果可用则使用硬件图形加速]

您可以勾选[启用富客户端视觉体验]

我在任何地方都遇到过很多问题,从随机崩溃到崩溃我的 Intel 图形显示驱动程序,我将其关闭并且没有任何问题,它实际上运行得更好。也许它对你有用

Visual Studio 使用 WPF: 来自 this link:“Windows Presentation Foundation (WPF) 不同于 Windows 上的先前应用程序平台,因为它使用自己的 DirectX-based hardware-accelerated渲染管道,当可用时,绘制任何 WPF windows 的内容。以前的应用程序平台通常对显示驱动程序质量的依赖要少得多,因为它们的大部分渲染是在软件而不是硬件中完成的。” 因此,如果您没有最新的显示驱动程序或最新的 .NET 框架,它可能会与显示驱动程序冲突导致它停止。尽管可能还有其他原因。

还有一个注册表设置 (regedit) 可能会有所帮助: 您可以通过转至 [HKEY_LOCAL_MACHINE->SYSTEM->CurrentControlSet->Control->GraphicsDrivers] 添加新的 DWORD(对于 32 位系统)或 QWORD(对于 64 位) 并将名称设置为“TdrDelay”,将值设置为“8”。确保值的基数设置为十六进制。 TDR- 超时检测和恢复。

如果上述任何一个都不起作用。尝试从 [Tools->Options] 中禁用 Visual Studio 中的任何硬件加速渲染功能。从您的 ActivityLog 文件来看,异常似乎主要出现在图形方法中。所以,我猜它与图形渲染有关。

我在团队资源管理器中遇到了同样的问题。 首先关闭 visual studio 的所有实例,然后尝试:

devenv /resetuserdata

运行 以上命令在命令提示符下;通常类似于 "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE"


我遇到了 visual studio 安装问题 它在开始安装之前停止,我只是转到控制面板 > 程序 > 打开或关闭 windows 功能 > 取消选中所有 .NETframework 版本并重新启动机器,然后开始安装 这就是我的工作方式

您也可以尝试关闭 VS,删除 bin 目录,然后再次尝试调试 – 它对我有效。

已经有一段时间了,但从今天开始我就看到了类似的行为。 每次我加载我们的解决方案时,VS2015 都会崩溃并重新启动。 Windows 事件日志显示 'out of memory exception' 但崩溃时有超过 2GB 的可用空间。故障模块是 KERNELBASE.DLL

如果这对任何人有帮助:

Faulting application name: devenv.exe, version: 14.0.25420.1, time stamp: 0x57685d85
Faulting module name: KERNELBASE.dll, version: 6.1.7601.23915, time stamp: 0x59b94abb

我怀疑是 windows 更新,因为我的 none 同事遇到了这个问题,不幸的是我就是那个总是尽快安装更新的书呆子。

我找到了这篇 SOF 文章并尝试了所有列出的内容。

而且我发现了这个巫术的新警告。

我的属于 "the dumbest reason ever" 类别。

我的临时文件夹是 "full"。所以我做了一个磁盘清理,并删除了文件。但是,我的临时文件夹中有大量子文件夹,虽然它们是空的,但文件夹本身导致 GetTempFile 函数失败。

所以当我运行

"C:\blah\blah\blah\IDE\devenv.exe" /log

ActivityLog.xml 中的日志条目显示如下:

System.IO.IOException: The file exists.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.__Error.WinIOError()
   at System.IO.Path.InternalGetTempFileName(Boolean checkHost)
   at System.Windows.Input.Cursor.LoadFromStream(Stream cursorStream)
   at Microsoft.VisualStudio.Text.Editor.Implementation.LeftSelectionMargin.get_RightArrowCursor()
   at Microsoft.VisualStudio.Text.Editor.Implementation.LeftSelectionMarginProvider.CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
   at Microsoft.VisualStudio.Text.Utilities.ContainerMargin.<AddMargins>b__2(IWpfTextViewMarginProvider mp)
   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy`2 provider, Func`2 getter)

在该日志条目文本中,不要遗漏文本 "System.IO.Path.InternalGetTempFileName"

所以好几个地方都说了"delete your temp files",我也是,但是我还是遇到了同样的问题。 :(

然后我看了一下临时目录,我看到了一些奇怪的东西。大量(空)子文件夹。

所以一旦我发现我的临时目录中有一堆子文件夹,我就清理了这些子文件夹。

我发现了这个问题:

How to delete files/subfolders in a specific directory at command prompt in Windows

所以我使用了这段代码:

我把这段代码放在一个 .bat 文件中

del /q "C:\Users\MYUSERNAME\AppData\Local\Temp\*"
FOR /D %%p IN ("C:\Users\MYUSERNAME\AppData\Local\Temp\*.*") DO rmdir "%%p" /s /q

现在我的 Visual Studio 又 运行 好了。

哇,算了。

单击工具菜单 > 导入和导出设置 > 重置所有设置 > 下一步 > "No, just reset settings, overwriting all current settings" > 下一步 > 完成。

如果您正在使用 windows 10. 尝试安装 VS2015 更新 3

https://docs.microsoft.com/en-us/previous-versions/mt752379(v=vs.140)?redirectedfrom=MSDN