When ASP.NET CORE release does not compile Views folder

      .net core 3.0 official version has been released, the current overall has been relatively stable, and can be developed for production.

     By default when you publish Views is compiled directly into a DLL file (XXXXXX.Views.dll), routine development and maintenance process, often display information to modify some pages, so will need to be recompiled release, can not directly modify the page replacement, relatively trouble spots as long as the compiler release or certain risks. Not too convenient for maintenance. How not to compile Views folder, you need the following:

   When I use the .net core 3.0 official version 

    1, the installation references Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation by nuget, version V3.0.0.

    2, modified to increase the project file <RazorCompileOnPublish> false </ RazorCompileOnPublish> shown below:

   

 

 

   3, the method of modifying Startup.cs ConfigureServices

 

 

   When such release will not edit the Views folder, this folder will be alone, it will be compiled at runtime. This can directly modify the view file.

 

Guess you like

Origin www.cnblogs.com/burnsoft/p/11724404.html