For Umbraco 9 this can be done directly in your csproj file of your website.
<!-- Set this to true if ModelsBuilder mode is not InMemoryAuto-->
<PropertyGroup>
<RazorCompileOnBuild>true</RazorCompileOnBuild>
<RazorCompileOnPublish>true</RazorCompileOnPublish>
</PropertyGroup>
Compile views
Hi, after deployment of our website on Azure, first access to each doc type is slow.
I would like to compile views.
With v8 the msbuild PrecompileBeforePublish=true switch was available.
How can this be done with v9 ?
I've tried the following : https://github.com/umbraco/Umbraco-CMS/issues/11758 without success.
Note : We are using .net core 6.
Thank you
Hi Alexandre
For Umbraco 9 this can be done directly in your csproj file of your website.
Dave
Thanks Dave, but I have tried this and it does not work.
Hi Alexandre,
For me that works. I see a dll {ProjectName}.Views.dll in my bin folder when setting these values to true.
Can you check that.
Dave
I do not see any xxx.Views.dll generated.
Are you using .net core 6 ?
Hi Alexandre,
I am running .NET 5
But for me that dll shows up after I build the project.
Dave
Hi Alexandre,
From .NET 6 it won't produce a seperate assembly anymore.
See https://docs.microsoft.com/en-us/dotnet/core/compatibility/aspnet-core/6.0/razor-compiler-doesnt-produce-views-assembly
Dave
You are right thank you!
Any idea why it works when compiling but not when publishing ? (event if RazorCompileOnPublish is set to true)
is working on a reply...