title: Numerous instances of VBCSCompiler.exe
body: <p>I just recently downloaded and installed Visual Studio Professional 2015 (14.0.23107.0). The first time I opened up our solution (28 projects) and performed a Build -> Rebuild Solution, my development machine came to an absolute crawl. The CPU was maxed out at 100% and the build never completed - even after > 10 minutes.</p>
  
  <p>I opened up Windows Task Manager and noticed: > 10 VBCSCompiler.exe tasks running. When combined, these tasks sent the CPU > 90%.</p>
  
  <p>Any idea why there are so many of these tasks running? Any way to stop this from happening?</p>
  
  <p>This is the closest thing I can find to someone else experiencing the same issue: <a href="https://github.com/dotnet/roslyn/issues/2790">https://github.com/dotnet/roslyn/issues/2790</a></p>
  
  <p><strong>Update (8/7)</strong></p>
  
  <p>-Hans Passant, great thought. My manager provided me with this release (14.0.23107.0). Is this the correct version for the "official release"?? I did not knowingly install any of the per-release versions of Visual Studio 2015. I don't think there are any beta bits lying around.</p>
  
  <p>-Kyle Trauberman, I'm not that familiar with environment variables in the context of Visual Studio; however, I naively ran <code>set DisableRosyln=true</code> in a VS (and MSBuild) Command Prompt Window. This did not seem to have any impact. VBCSCompiler.exe showed right back up even after restarting VS2015.</p>
  
  <p>I repaired my VS2015 install and performed a reboot. This did not help.</p>
  
  <p><strong>Update Part 2 (8/7)</strong>
  -Hans Passant, very impressive write up!! Although, the problem didn't happen this time around, I took a look at the things you described:</p>
  
  <p>As far as the modules loaded with the VBCSCompiler.exe, here's what I have:</p>
  
  <p><a href="https://i.stack.imgur.com/rPd61.png"><img src="https://i.stack.imgur.com/rPd61.png" alt="enter image description here"></a></p>
  
  <p>It's interesting that our .NET core assemblies are at different versions. You're at 4.06.79 while, I'm at 4.06.81.</p>
  
  <p>My "client side dlls" (located at C:\Program Files (x86)\MSBuild\14.0\Bin\Microsoft.Build.Tasks.CodeAnalysis.dll) are at the same version and time stamp as yours:
  <a href="https://i.stack.imgur.com/kcXmI.png"><img src="https://i.stack.imgur.com/kcXmI.png" alt="enter image description here"></a></p>
  
  <p>Oddly enough, when I look at the code in ILSpy, I see something slightly different - optimization perhaps?</p>
  
  <pre><code>    private static NamedPipeClientStream TryAllProcesses(string pipeName, int timeoutMs, CancellationToken cancellationToken, out string newPipeName)
  {
      string str = pipeName;
      int num = 1;
      while (File.Exists(string.Format("\\\\.\\pipe\\{0}", pipeName)))
      {
          NamedPipeClientStream result;
          if ((result = BuildClient.TryConnectToProcess(pipeName, timeoutMs, cancellationToken)) != null)
          {
              newPipeName = pipeName;
              return result;
          }
          pipeName = str + "." + num.ToString(CultureInfo.InvariantCulture);
          num++;
      }
      newPipeName = pipeName;
      return null;
  }
  </code></pre>
  
  <p>**Let me get back with you on the specific pipname argument passed to the instances of VBCSCompiler.exe. I will have to wait until it happens again.</p>