From cc266a7963a32ce8dccfbccfc6dbecbbb2d626fc Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Wed, 16 Apr 2025 09:59:33 +0200 Subject: [PATCH 1/2] Added note on running production mode from source. --- .../fundamentals/setup/server-setup/runtime-modes.md | 10 ++++++++++ .../fundamentals/setup/server-setup/runtime-modes.md | 10 ++++++++++ .../fundamentals/setup/server-setup/runtime-modes.md | 10 ++++++++++ .../fundamentals/setup/server-setup/runtime-modes.md | 10 ++++++++++ 4 files changed, 40 insertions(+) diff --git a/13/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md b/13/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md index afba35a7fb7..a45ea170ed8 100644 --- a/13/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md +++ b/13/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md @@ -116,6 +116,16 @@ Also, templates cannot be edited on live environment as runtime compilation is n Also ensure the `UmbracoApplicationUrl` is updated to the primary URL of your production environment, as this is used when sending emails (password reset, notifications, health check results, etc.) and the keep-alive task. +{% hint style="info" %} +Static web assets are disabled when using Production mode, following [Microsoft guidance](https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/static-files?view=aspnetcore-7.0#static-files-in-non-development-environments). If you are running a non-Development environment using the Production runtime mode from source (non-published output), you will need to explicitly enable this. You can add the following line of code to your `Program.cs` file: + +```csharp +builder.WebHost.UseStaticWebAssets(); +``` + +This should not be used in a more typical production environment where you are hosting your application from published output. +{% endhint %} + ## Customize/extend runtime mode validation Validation of the above-mentioned settings is done when determining the runtime level during startup using the new `IRuntimeModeValidationService` and when it fails, causes a `BootFailedException` to be thrown. The default implementation gets all registered `IRuntimeModeValidators` to do the validation, making it possible to remove default checks and/or add your own (inherit from `RuntimeModeProductionValidatorBase`, if you only want to validate against the production runtime mode). The following validators are added by default: diff --git a/14/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md b/14/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md index 343fe387268..1f5a398e70f 100644 --- a/14/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md +++ b/14/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md @@ -115,6 +115,16 @@ Also, templates cannot be edited on live environment as runtime compilation is n Also ensure the `UmbracoApplicationUrl` is updated to the primary URL of your production environment, as this is used when sending emails (password reset, notifications, health check results, etc.) and the keep-alive task. +{% hint style="info" %} +Static web assets are disabled when using Production mode, following [Microsoft guidance](https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/static-files?view=aspnetcore-7.0#static-files-in-non-development-environments). If you are running a non-Development environment using the Production runtime mode from source (non-published output), you will need to explicitly enable this. You can add the following line of code to your `Program.cs` file: + +```csharp +builder.WebHost.UseStaticWebAssets(); +``` + +This should not be used in a more typical production environment where you are hosting your application from published output. +{% endhint %} + ## Customize/extend runtime mode validation Validation of the above-mentioned settings is done when determining the runtime level during startup using the new `IRuntimeModeValidationService` and when it fails, causes a `BootFailedException` to be thrown. The default implementation gets all registered `IRuntimeModeValidators` to do the validation, making it possible to remove default checks and/or add your own (inherit from `RuntimeModeProductionValidatorBase`, if you only want to validate against the production runtime mode). The following validators are added by default: diff --git a/15/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md b/15/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md index 566939604ce..a4a7cabd963 100644 --- a/15/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md +++ b/15/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md @@ -122,6 +122,16 @@ Also, templates cannot be edited on live environment as runtime compilation is n Also ensure the `UmbracoApplicationUrl` is updated to the primary URL of your production environment, as this is used when sending emails (password reset, notifications, health check results, etc.). +{% hint style="info" %} +Static web assets are disabled when using Production mode, following [Microsoft guidance](https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/static-files?view=aspnetcore-7.0#static-files-in-non-development-environments). If you are running a non-Development environment using the Production runtime mode from source (non-published output), you will need to explicitly enable this. You can add the following line of code to your `Program.cs` file: + +```csharp +builder.WebHost.UseStaticWebAssets(); +``` + +This should not be used in a more typical production environment where you are hosting your application from published output. +{% endhint %} + ## Customize/extend runtime mode validation Validation of the above-mentioned settings is done when determining the runtime level during startup using the new `IRuntimeModeValidationService` and when it fails, causes a `BootFailedException` to be thrown. The default implementation gets all registered `IRuntimeModeValidators` to do the validation, making it possible to remove default checks and/or add your own (inherit from `RuntimeModeProductionValidatorBase`, if you only want to validate against the production runtime mode). The following validators are added by default: diff --git a/16/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md b/16/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md index 566939604ce..a4a7cabd963 100644 --- a/16/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md +++ b/16/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md @@ -122,6 +122,16 @@ Also, templates cannot be edited on live environment as runtime compilation is n Also ensure the `UmbracoApplicationUrl` is updated to the primary URL of your production environment, as this is used when sending emails (password reset, notifications, health check results, etc.). +{% hint style="info" %} +Static web assets are disabled when using Production mode, following [Microsoft guidance](https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/static-files?view=aspnetcore-7.0#static-files-in-non-development-environments). If you are running a non-Development environment using the Production runtime mode from source (non-published output), you will need to explicitly enable this. You can add the following line of code to your `Program.cs` file: + +```csharp +builder.WebHost.UseStaticWebAssets(); +``` + +This should not be used in a more typical production environment where you are hosting your application from published output. +{% endhint %} + ## Customize/extend runtime mode validation Validation of the above-mentioned settings is done when determining the runtime level during startup using the new `IRuntimeModeValidationService` and when it fails, causes a `BootFailedException` to be thrown. The default implementation gets all registered `IRuntimeModeValidators` to do the validation, making it possible to remove default checks and/or add your own (inherit from `RuntimeModeProductionValidatorBase`, if you only want to validate against the production runtime mode). The following validators are added by default: From 66f97aee7b1a9d0fb29732a0335d421bba55b503 Mon Sep 17 00:00:00 2001 From: sofietoft Date: Wed, 23 Apr 2025 10:56:44 +0200 Subject: [PATCH 2/2] Trigger GitBook Checks --- 15/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/15/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md b/15/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md index a4a7cabd963..715a677eb24 100644 --- a/15/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md +++ b/15/umbraco-cms/fundamentals/setup/server-setup/runtime-modes.md @@ -129,7 +129,7 @@ Static web assets are disabled when using Production mode, following [Microsoft builder.WebHost.UseStaticWebAssets(); ``` -This should not be used in a more typical production environment where you are hosting your application from published output. +This should not be used in a more typical production environment where you are hosting your application from published output. {% endhint %} ## Customize/extend runtime mode validation