Answers are not a solution. The stuff of .NET 6 # is quite different from what we used. A lot has changed - from the need to deal with portable libraries, so that Visual Studio 2015 installs the old compiler (it cost me four hours to crack my head).
In short: stack overflow question How to use C # 6 with a website project type?
You need to install the C # .NET compiler (now it starts as a bla bla bla service). and you need to run updates on NuGet to get the latest (before trying anything else).
The compiler must be installed in the project from which your solution is executed (for example, your website or your main project, from which your application starts (if you have several projects)).
Once you have installed this, sort your web.config, referring to any portable libraries, and delete both the bin folder and obj (to avoid working on my computer's nightmare), it should just start. But be patient; what happens on your computer may vary depending on the answers above. Most of the answers above hide other problems. It may work for a while, and then boom: a compiler error. Several pages worked for me, then some pages started crashing due to some packages that started using portable libraries.
PBo Apr 7 '16 at 21:14 2016-04-07 21:14
source share