Be careful following this answer tip. Although this solves the problem at hand, it can cause other problems at a later stage.
I have the same problem. Apparently, the .NET compiler was not loaded in the GAC . What I did to solve it was:
First, in the package manager console, type:
PM> Install-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
Now, for some reason, the lovely Microsoft gentlemen have decided not to install it in the GAC for us. You can do this manually by opening the Developer Command Prompt and typing:
gacutil -i "C:\*PATH TO YOUR APP CODE*\bin\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll"
Conclusion
Microsoft is trying to encourage everyone to do everything with nuget, which may be fine without the random errors you encounter on the nuget system. Try to use the same project in different solutions, accidentally (or not) update one of the many threads that he uses for one of them, and if you are not lucky, you will understand what I mean when you try to build another solution . On the other hand, placing files in the GAC can also cause future problems, as people tend to forget what they put there, and then when setting up new environments they forget to include these files. Another possible solution is to place the files in a central folder for third-party DLLs (even if it is strange to call a third-party compiler), which creates problems with broken links when setting up new environments. If you decide to install the dll in the GAC, be careful and remember that you did it. If you do not, download nuget for each project again and bear all the annoying errors caused by it (at least it used to be when I got tired of it and I just put the files in the GAC). Both approaches can cause you a headache and create problems, it's just a matter of what problems you prefer to deal with. Microsoft recommends using the nuget system, and as a rule, it is better to listen to it than an unknown programmer in SO, if you are not tired of the nuget system and are not used to dealing with the GAC long enough to become a better alternative. for you.
Yuval Perelman Jan 21 '16 at 12:40 2016-01-21 12:40
source share