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
What worked for me... It seems if you install (or a dependent package installs) Microsoft.CodeDom.Providers.DotNetCompilerPlatform NuGet package it makes some web.config transforms that allow you to use C#7.x features in ASP.NET Razor pages. Whilst I found these worked fine on my local machine they didn't work on our server (even when the compiler was in the /bin/ folder).
The solution was to locate the element below and remove completely from web.config