I don\'t know what\'s wrong with my machine, but it\'s a while that I\'m getting the following strange error from ASP.NET (for all my applications).
Compilat
The answers provided are not the solution. The .NET 6# stuff is pretty different from what we used to. A lot has changed, from having to deal with portable libraries to Visual Studio 2015 installing an old compiler (it cost me four hours cracking my head).
The long story short: Stack Overflow question How do I use C# 6 with a Web Site project type?
You need to install the C# .NET compiler (now runs as a service bla bla bla). and you need to run updates on NuGet to get the latest everything (before trying anything else).
The compiler must be installed on the project your solution runs from (so your website or your main project your application starts from (if you have multiple projects)).
Once you install that then sort out your web.config referencing any portable libraries, and delete both the bin
and obj
folder (to avoid works on my computer nightmare), It should just run. But be patient; what happens on your machine may vary as much as the answers above. Most of the answers above hide other problems. It may work for a while, then boom: compiler error. I had a few pages working, then some pages started failing because of some packages that have started using portable libraries.
Updating Nuget packages fixed proglem for me.