Before ASP.NET Core MVC, we would use RazorGenerator to compile views into assemblies, and we would reuse those views in another project, by introducing a custom ViewEngine that would load the view from the assembly instead of file-system.
In ASP.NET Core MVC there is this concept of pre-compiled views and it works out of the box for version 2.0 and creates an assembly that by convention has the name of project_name.PrecompiledViews.dll.
I have two problems though that I can't find an answer for on Google.
First I don't know how to reuse that DLL in another project. Like if I have About.cshtml
page in CompanyBase.dll
, how can I reuse that page/view in ProjectAlpha
?
And also I don't want view compilation to happen on publish. How can I change it to happen on build?