diff --git a/BTCPayServer.Tests/BTCPayServer.Tests.csproj b/BTCPayServer.Tests/BTCPayServer.Tests.csproj index 96977d796..e000157bd 100644 --- a/BTCPayServer.Tests/BTCPayServer.Tests.csproj +++ b/BTCPayServer.Tests/BTCPayServer.Tests.csproj @@ -41,6 +41,7 @@ + diff --git a/BTCPayServer/BTCPayServer.csproj b/BTCPayServer/BTCPayServer.csproj index 0b8e662bc..aa649ba1e 100644 --- a/BTCPayServer/BTCPayServer.csproj +++ b/BTCPayServer/BTCPayServer.csproj @@ -8,6 +8,19 @@ False False + + + + + false + + + true + + + $(DefineConstants);RAZOR_COMPILE_ON_BUILD + + <_Parameter1>$(GitCommit) @@ -68,7 +81,7 @@ - + diff --git a/BTCPayServer/Hosting/Startup.cs b/BTCPayServer/Hosting/Startup.cs index de294a8ec..f98368947 100644 --- a/BTCPayServer/Hosting/Startup.cs +++ b/BTCPayServer/Hosting/Startup.cs @@ -141,7 +141,7 @@ namespace BTCPayServer.Hosting services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); - services.AddMvc(o => + var mvcBuilder = services.AddMvc(o => { o.Filters.Add(new XFrameOptionsAttribute(XFrameOptionsAttribute.XFrameOptions.Deny)); o.Filters.Add(new XContentTypeOptionsAttribute("nosniff")); @@ -167,11 +167,14 @@ namespace BTCPayServer.Hosting o.PageViewLocationFormats.Add("/{0}.cshtml"); }) .AddNewtonsoftJson() - .AddRazorRuntimeCompilation() .AddPlugins(services, Configuration, LoggerFactory, bootstrapServiceProvider) .AddDataAnnotationsLocalization() .AddControllersAsServices(); +#if !RAZOR_COMPILE_ON_BUILD + mvcBuilder.AddRazorRuntimeCompilation(); +#endif + services.AddServerSideBlazor(); LowercaseTransformer.Register(services); diff --git a/Build/Common.csproj b/Build/Common.csproj index d3a4bf8b1..1fd72ab1e 100644 --- a/Build/Common.csproj +++ b/Build/Common.csproj @@ -12,8 +12,4 @@ Debug;Release AnyCPU - - - false -