Fix compiler issue when no Razor view is compiled

  • Updated

This article is subjected to CMS 12 and Net Core platform.


All pages return with the error like this:

The view 'Index' was not found. The following locations were searched:

When viewing the compiled DLL, there's no generated code under the namespace "AspNetCoreGeneratedDocument" where all Razor views are compiled.


Resolve the problem

Remove the package dependency Microsoft.Net.Compilers.Toolset from all CSPROJ files in your code projects.

After rebuilding the code solution, all CSHTML files are compiled and added to the assembly: