VS 2015突然变得非常缓慢

时间:2016-12-04 00:03:14

标签: .net visual-studio-2015 build msbuild

我不确定我做了什么,但是VS 2015 Update 3曾经在18秒内完全重建了13个C#项目,现在大约需要143秒。除此之外,VS性能不变。重新启动,没有变化。

我注意到的一件事是我曾经在任务管理器中看到VBCSCompiler.exe,但现在我只看到csc.exe。然后我运行了msbuild.exe Project.sln /t:Clean,Build,它的构建速度与Visual Studio一样快 - 即使在构建完成后,任务管理器中也会显示VBCSCompiler.exe

这里发生了什么?

编辑:在发生这种情况的时候我还安装了Visual Studio" 15"预览4(我没有注意这些事件的时间因为我认为VS安装是相互隔离的) - 但是VS 15在我安装它之后完全破坏了,现在在启动时崩溃了。我还注意到,当我重启VS 2015时,它说" CSharpVsInteractiveWindowPackage'包没有正确加载。" ActivityLog.xml包含以下错误:

CreateInstance failed for package [CSharpVsInteractiveWindowPackage]Source: 'mscorlib' Description: Could not load file or assembly 'Microsoft.VisualStudio.InteractiveWindow, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

System.IO.FileLoadException: Could not load file or assembly 'Microsoft.VisualStudio.InteractiveWindow, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

File name: 'Microsoft.VisualStudio.InteractiveWindow, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

   at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)

   at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)

   at System.Activator.CreateInstance(String assemblyString, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)

   at System.Activator.CreateInstance(String assemblyName, String typeName)

   at System.AppDomain.CreateInstance(String assemblyName, String typeName)



WRN: Assembly binding logging is turned OFF.

To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.

Note: There is some performance penalty associated with assembly bind failure logging.

To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


2 个答案:

答案 0 :(得分:1)

由于它使用msbuild命令工作正常,我认为它与VS 2015本身更相关。

首先,请在visual studio 2015 update3上安装最新的KB(KB3165756),它将Visual Studio版本升级到版本14.0.25431.01 Update3。转到工具 - >扩展和更新,并检查此更新,如下所示:

enter image description here

其次,您可以尝试重命名或删除以下文件夹:

•C:\用户\\应用程序数据\本地\微软\ VisualStudio的\ 14.0

•C:\ Users \\ AppData \ Roaming \ Microsoft \ VisualStudio \ 14.0

答案 1 :(得分:0)

问题似乎是由“RC内部人员”扩展引起的,该扩展被列为Building Roslyn的先决条件。我按照卸载说明操作后修复了该问题:

  • 关闭VS的所有实例
  • 删除%LocalAppdata%\ Microsoft \ VisualStudio \ 14.0 \(注意,这将删除所有扩展,而不仅仅是Roslyn VSIX)
  • 从开发人员命令提示符
  • 运行devenv /updateconfiguration

诊断:在增加构建输出的详细级别(工具|选项|项目和解决方案|构建和运行| MSBuild项目构建输出详细程度)之后,我能够将我的构建过程与@ ColeWu-MSFT的构建日志。我注意到我的机器有不同的编译器:

1>CoreCompile:
1>  C:\Users\David\AppData\Local\Microsoft\VisualStudio\14.0\Extensions\slmkqtts.ana\csc.exe /noconfig /unsafe- etc etc etc

这是扩展已经取代我的编译器的主要提示(不是Roslyn构建指令中提到的内容)。此外,他的日志说“使用共享编译”(我怀疑这是VBCSCompiler.exe的代码)而我的没有。非常感谢你的帮助,科尔!