Why set `MvcRazorCompileOnPublish` to false? Shouldn't it be true
<MvcRazorCompileOnPublish> It was supposed to be true by default true in 2.0. But why is it set to false? And why setting it true gives an error on publishing the project.
Because the WebHost doesn't add reference to module projects and we are dynamic loading the modules at runtime. So the dependencies are not ready at the build time.
Compiling view at runtime is need for dynamic theming.
If the cshtml's were copied over via an msbuild target instead of gulp and included as Content items during a pre-publish/pre-precompile step, it could theoretically work but would go against the intention of changing things dynamically at runtime..
:)