Search code examples
asp.net-mvcmsbuildorchardcmsaspnet-compiler

Orchard CMS - View Compilation?


Is it possible to perform view compilation in Orchard?

Using the off-the-shelf latest dev branch, and setting MvcBuildViews to true results in all kinds of reference issues.

As an alternative, I tried doing this:

  1. build Precompiled - this works fine, no problem
  2. %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_compiler -f -v / -p c:\_src\orchard\build\Precompiled c:\temp\precompileoutput

But (2) fails, with the following error:

c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\fd596974\9555b8ff\App_Web_4psv3d0u.0.cs(34): error CS0246: The type or namespace name 'Lucene' could not be found (are you missing a using directive or an assembly reference?)

Am I pointing the tool at the wrong folder? Is it possible to create a folder that would work from the targets? Or is it just not possible to compile views in orchard without major divergence from the code base?

This guy seemed to manage it, and I think? i'm doing the same steps: https://blogs.msdn.microsoft.com/shacorn/2014/11/13/asp-net-precompilation-speeding-up-orchard-cold-start/

(The reason i am doing this is not for performance, but because there has been the occasional view compilation problem, which has not shown up until well into the testing phase).


Solution

  • I x-posted this in GitHub issues for Ochard. The answer is there: https://github.com/OrchardCMS/Orchard/issues/7713