Skip to content

Commit 95efeea

Browse files
committed
Ensure Umbraco Razor files are compiled into <project>.Views.dll
It worked properly if the Umbraco files are on disk before a build but when the files are not there yet or a dotnet clean is done first the files are not compiled. This is often the case on build servers that start with a clean working directory for each build. Using this target we simply ensure the files are included as "Content" which Razor will scan for .cshtml files in their "ResolveRazorGenerateInputs" target.
1 parent 5d2c950 commit 95efeea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

build/NuSpecs/buildTransitive/Umbraco.Cms.StaticAssets.targets

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,10 @@
8787
<RemoveDir Directories="@(WwwrootUmbracoPackageDir)" />
8888
</Target>
8989

90+
<Target Name="IncludeUmbracoRazorFiles" BeforeTargets="ResolveRazorGenerateInputs">
91+
<ItemGroup>
92+
<Content Include="$(MSBuildProjectDirectory)\umbraco\**\*.cshtml" />
93+
</ItemGroup>
94+
</Target>
95+
9096
</Project>

0 commit comments

Comments
 (0)