Recently I change my development environment and come across following issue while browsing website on localhost
The CodeDom provider type “Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=220.127.116.11, Culture=neutral, PublicKeyToken=31bf3856ad364e35” could not be located.
When i investigate this issue it turns out the project has Roslyn reference which new environment’s IIS does not support.
The solution is very simple, If you reinstall DotNetCompilerPlatform Nuget package it will resolve the issue.
Update-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -r