Dave de Moel
07/22/2024, 7:20 PMJason
07/22/2024, 9:14 PMJason
07/23/2024, 8:15 AMMatt Wise
07/23/2024, 8:39 AMJason
07/23/2024, 9:06 AMDave de Moel
07/23/2024, 3:20 PMDave de Moel
07/23/2024, 3:20 PMDave de Moel
07/23/2024, 3:22 PMJason
07/23/2024, 4:24 PMJason
07/23/2024, 4:25 PMDave de Moel
07/23/2024, 5:00 PMDave de Moel
07/23/2024, 5:02 PMDave de Moel
07/23/2024, 5:05 PMDave de Moel
07/23/2024, 5:09 PMDave de Moel
07/23/2024, 5:26 PMcsharp
public static class UmbracoBuilderExtensionsOwning
{
public static IUmbracoBuilder AddCustomBackOffice(this IUmbracoBuilder builder) => builder
.AddConfiguration()
.AddUmbracoCore()
.AddWebComponents()
.AddHelpers()
.AddBackOfficeCore()
.AddBackOfficeIdentity()
.AddBackOfficeAuthentication()
.AddTokenRevocation()
.AddMembersIdentity()
.AddUmbracoProfiler()
.AddMvcAndRazorWithHotReload()
.AddWebServer()
.AddRecurringBackgroundJobs()
.AddNuCache()
.AddDistributedCache()
.AddCoreNotifications()
.AddExamine()
.AddExamineIndexes();
private static IUmbracoBuilder AddMvcAndRazorWithHotReload(this IUmbracoBuilder builder, Action<IMvcBuilder>? mvcBuilding = null)
{
// TODO: We need to figure out if we can work around this because calling AddControllersWithViews modifies the global app and order is very important
// this will directly affect developers who need to call that themselves.
IMvcBuilder mvcBuilder = builder.Services.AddControllersWithViews();
mvcBuilding?.Invoke(mvcBuilder);
return builder;
}
}
Dave de Moel
07/23/2024, 5:26 PMjson
"Umbraco": {
"CMS": {
"ModelsBuilder": {
"AcceptUnsafeModelsDirectory": true,
"ModelsNamespace": "Umbraco.Cms.Web.Common.PublishedModels",
"ModelsDirectory": "~/umbraco/models",
"ModelsMode": "SourceCodeAuto"
},
...
Dave de Moel
07/23/2024, 5:27 PMxml
<PropertyGroup>
<!-- Remove RazorCompileOnBuild and RazorCompileOnPublish when not using ModelsMode InMemoryAuto -->
<RazorCompileOnBuild>false</RazorCompileOnBuild>
<RazorCompileOnPublish>false</RazorCompileOnPublish>
</PropertyGroup>
and added:
xml
<ItemGroup>
<Watch Include="$(MSBuildProjectDirectory)\**\*.cshtml" />
</ItemGroup>
Dave de Moel
07/23/2024, 5:27 PMDave de Moel
07/23/2024, 5:30 PMMatt Wise
07/23/2024, 5:32 PMDave de Moel
07/23/2024, 5:32 PMDave de Moel
07/23/2024, 6:11 PM