Symptoms: ASP.NET MVC website sporadically crashes and all .cshtml pages requests fail with this error. The problem seems random and happens once or twice a month. The site may run for months with no issues then out of the blue it will stop serving any .cshtml pages and gives the error on every .cshtml page request. A restart of the website is the only solution (or redeploy, which causes the same thing).
This was a very difficult problem to debug since it was so sporadic and none of the other answers I found helped, they did not address the problem where the site would deploy and run for long periods of time then crash with this error seemingly randomly. In the end I got some help from Microsoft.
I have .NET Framework 4.6.2 on windows server 2016