Turn off precompilation of Razor views

When precompiling views, you benefit from faster loading times and better performance. However, you may want to disable the precompilation of Razor views if:

  • You are not publishing to Live environment or you want to disable precompilation for a folder.
  • After upgrade, your Visual Basic project is not built or an error is thrown during site initialization. That is, there are problems with the compilation of your Visual Basic project.

You can solve both issues, listed above, by turning off precompilation of Razor views in Sitefinity CMS:

  1. In Visual Studio, open the context menu of your Sitefinity CMS project and click Unload Project. Edit the project file of the web application, which, by default, is SitefinityWebApp.vbproj, or .csproj, respectively.
  2. Depending on whether you installed the Telerik.Sitefinity.Feather NuGet package, do one of the following:
    • If the package is installed, comment out the following import elements:
    • If the package is not installed, comment out the following import elements:
  3. Save and close the file.
  4. Open the context menu of Project and click Reload Project.
  5. Rebuild the solution.

Tags

Was this article helpful?