title: Microsoft.Net.Compilers greatly increases compile time
body: <p>On a relatively small solution (40 projects) I'm trying to implement the Microsoft.Net.Compilers Nuget package. I did this via the <code>Directory.build.props</code> file:</p>
  
  <pre><code>&lt;Project&gt;
    &lt;ItemGroup&gt;
      &lt;PackageReference Include="Microsoft.Net.Compilers" Version="2.8.0"/&gt;
      &lt;!-- some other packages down below here that where already there --&gt;
    &lt;/ItemGroup&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>Before using the package it would take about 18 seconds to compile the entire project from scratch in visual studio 2017 (15.7.0). After implementing the package it takes about 80 seconds. I can imagine that the nuget package would make things a little slower. But I would not expect it to take 4 times as long.</p>
  
  <p>While looking around on the internet I found <a href="https://github.com/dotnet/roslyn/issues/12360" rel="nofollow noreferrer">https://github.com/dotnet/roslyn/issues/12360</a> the user there describes more or less the same symptoms I've noticed (multiple csc.exe's claiming full CPU power while compiling. difference is I do have a VBCSompiler.exe but it is claiming 0% cpu.) I tried the workaround in that discussion of setting the <code>UseSharedCompilation</code> property to true in my csproj files (the property did not exist before), but that didn't help. </p>
  
  <p><strong>TLTR:</strong>
  Is there some reason why the Microsoft.Net.Compilers greatly increases compile time? Or perhaps a way to see where all the time is going?</p>
  
  <p><strong>version summary:</strong></p>
  
  <ul>
  <li>Visual studio version: 15.7.0 </li>
  <li>C# level: 7</li>
  <li>Microsoft.Net.Compilers version: 2.8.0</li>
  <li>ms .net 4.6.1</li>
  </ul>