If you’re using VS 2015 for development, ASP.NET projects now use Roslyn by default. The host I use as a test server doesn’t support Roslyn / C# 6.0 yet. Though the website gets published successfully (using Web Deploy), I end up with an Internal Server Error.
According to this, roslyn support is added using a nuget package. So the first thing to do, is to remove the package. Open the Package Manager Console and type the following one line at a time:
1uninstall-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
2uninstall-package Microsoft.Net.Compilers
Now, remove the following code from web.config:
That’s it.
Obviously, your code shouldn’t be using any C# 6 feature at this point.