Please check that you have version 2.0.1 of Microsoft.Codedom.Providers.DotNetCompilerPlatform NuGet package installed for the MVC project.
You can check it by opening the MVC project in Visual Studio -> right-click solution -> Manage NuGet Packages for Solution -> Installed -> search for Microsoft.CodeDom.Providers.DotNetCompilerPlatform.