2

I updated VS to the last version (16.8.1) and compilation process is very slow (10+ minutes, which got 20 sec before). I see on log and see that it delays on

Using shared compilation with compiler from directory: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn

it pulls 100% CPU and all 16 Gb of memory. How to fix it and switch off this shared compilation feature?

ADDED 11/17/2020

I added

<UseSharedCompilation>False</UseSharedCompilation>

to every <PropertyGroup> for every project in my solution, but problem is not solved!

Oleg Sh
  • 8,496
  • 17
  • 89
  • 159
  • Not sure, but does [this](https://stackoverflow.com/q/47590068/10871073) help? – Adrian Mole Nov 14 '20 at 00:18
  • What type of project, and what was the "before" version? – dxiv Nov 14 '20 at 04:52
  • @dxiv solution has many projects: class libraries, web, azure functions... Before version - not sure, but previous version was installed approx 1 month ago – Oleg Sh Nov 16 '20 at 15:08
  • @AdrianMole added to my main question – Oleg Sh Nov 17 '20 at 12:54
  • @dxiv I have the same problem. In my case upgraded from one of the latest 16.7.x version to 16.8.1. – Dejan Nov 18 '20 at 20:13
  • What I have noticed so far: on my machine `dotnet build` works but building from VS 16.8.1 does not. One difference: the first uses `C# Compiler version 3.5.0-beta4-20153-05 (20b9af91)` from `C:\Program Files\dotnet\sdk\3.1.201` (which is correct according to our `global.json`). And VS uses `C# Compiler version 3.8.0-5.20519.18 (4c195c3a)` from `Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn\csc.exe`. Could this point to the problem? – Dejan Nov 18 '20 at 21:21

1 Answers1

1

I had the exact same problem after upgrading to VS 16.8.1. And while dotnet build continued to work, I couldn't compile my solution anymore: the compiler started by VS would eat up all the available memory (RAM) before finishing its job (see my comments on the question).

Setting <UseSharedCompilation>False</UseSharedCompilation> did not help either.

So I had to "downgrade" Visual Studio back to 16.7.8 by following these instructions. This helped me to have a working IDE back in place.

Dejan
  • 9,150
  • 8
  • 69
  • 117