Qwertie
Qwertie

Reputation: 17186

VS 2015 suddenly builds very slowly

I'm not sure what I did, but VS 2015 Update 3 used to to a full rebuild of 13 C# projects in 18 seconds, and now it takes about 143 seconds. Other than that, VS performance is unchanged. Rebooted, no change.

One thing I noticed is that I used to see VBCSCompiler.exe in Task Manager, but now I only see csc.exe. Then I ran msbuild.exe Project.sln /t:Clean,Build and it built as quickly as Visual Studio used to - with VBCSCompiler.exe shown in Task Manager even after the build finished.

What's going on here?

Edit: around the time this happened I also installed Visual Studio "15" Preview 4 (I paid no attention to the timing of these events because I assumed VS installs are isolated from each other) - but VS 15 broke completely the day after I installed it and now crashes on startup. I also noticed that when I restart VS 2015, it says "The 'CSharpVsInteractiveWindowPackage' package did not load correctly." ActivityLog.xml contains the following error:

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].


Upvotes: 2

Views: 194

Answers (2)

Qwertie
Qwertie

Reputation: 17186

The problem appears to have been caused by the "RC insider" extension which is listed as a prerequisite for Building Roslyn. The problem was fixed after I followed the uninstall instructions:

  • Close all instances of VS
  • delete %LocalAppdata%\Microsoft\VisualStudio\14.0\ (Note, this will delete all your extensions, not just the Roslyn VSIX)
  • run devenv /updateconfiguration from a developer command prompt

Diagnosis: After increasing the detail level of my build output (Tools | Options | Projects and Solutions | Build and Run | MSBuild project build output verbosity), I was able to compare my build process with @ColeWu-MSFT's build log. I noticed that my machine had a different compiler:

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

This was the main hint that an extension had replaced my compiler (not something that the Roslyn build instructions bother to mention). Also, his log said "Using shared compilation" (I suspect that's code for VBCSCompiler.exe) while mine did not. Thank you very much for the help, Cole!

Upvotes: 0

Zhanglong Wu - MSFT
Zhanglong Wu - MSFT

Reputation: 1660

Since it works fine by using msbuild command, I think it is more related to the VS 2015 itself.

Firstly, please install the newest KB (KB3165756) on visual studio 2015 update3, which will upgrade your visual studio version to Version 14.0.25431.01 Update3. Go to Tools -> Extensions and updates and check this update like the following:

enter image description here

Secondly, you can try to rename or delete the following folders:

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

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

Upvotes: 1

Related Questions