Seems to be a fairly common problem with Visual Studio. You could try updating this package: Microsoft.CodeDom.Providers.DotNetCompilerPlatform
Or installing these packages:
Microsoft.CodeAnalysis.Compilers
Microsoft.Net.Compilers
Otherwise if possible update your Visual Studio to a higher major version.
p.s. For these kind of problems you can also create an issue ticket on github instead: https://github.com/episerver/Foundation/issues
Thanks for the reply. I had to kind of start over again. The instruction document should mention that the setup only works for Node.js version 14 (https://nodejs.org/en/blog/release/v14.17.3/) because node-sass version is 4.14. None of the steps described in the document is needed if the Additional Tools are installed in the Node installation. That installs Chocolatey, VS Tools, Python etc. We need to make sure .Net Framework 4.7.2 or up is installed in the machine.
I am trying to install Foundation on a Windows 2016 server following this document https://support.optimizely.com/hc/en-us/articles/360039069832-Episerver-Foundation-Installation-Guide
I am getting a bunch of errors like the below on the build step
CSC : error CS8032: An instance of analyzer Microsoft.CodeQuality.Analyzers.QualityGuidelines.AvoidDuplicateElementInitialization cannot be created from F:\Foundation\packages\Microsoft.CodeQuality.Analyzers.3.3.0\analyzers\dotnet\cs\Microsoft.CodeQuality.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.. [F:\Foundation\Src\Foundation\Foundation.csproj]
The below article says I should have VS2017 15.9 which I have installed.
https://github.com/dotnet/roslyn-analyzers/issues/3346
What can be the problem? What else do I need to check?