Last updated
Was this helpful?
Last updated
Was this helpful?
Download the .NET Core Runtime from the .
Ensure you download the version that matches your project’s requirements, which can be found in the article.
Download the to enable IIS to run ASP.NET Core applications.
After installing .NET Core Runtime, restart IIS to ensure the changes are applied.
Open Command Prompt as Administrator.
Run the following commands:
Next, create a new site in IIS for hosting Umbraco.
Open IIS Manager.
Right-click on Application Pools in the Connections panel.
Select Add Application Pool.
Enter the Name.
Ensure the .NET Common Language Runtime (CLR) version is set to No Managed Code.
Click Ok.
Open IIS Manager.
Right-click on Sites in the Connections panel.
Select Add Website.
Fill in the Site Name, Physical Path (to your Umbraco installation), and the Port.
Click Ok.
You can either use the dotnet CLI or Visual Studio to publish your Umbraco website.
Open the Command Prompt in the directory of your Umbraco project.
Run the following command:
Make sure to replace net9.0 with the version of .NET you are using.
Open your project in Visual Studio.
Right-click on the Umbraco project in Solution Explorer.
Select Publish....
In IIS, you can configure environment variables for Umbraco to store sensitive data such as your connection string.
Open IIS Manager and select your Umbraco site.
Double-click Configuration Editor in the Management section.
Select system.webServer/aspNetCore
in the Section dropdown.
Select ApplicationHost.config <location path='[YOUR-SITENAME]'>
in the From dropdown.
This ensures your settings will be stored in a machine specific file. The configuration files might end in a public repository and should not contain sensitive data like Connection Strings or Simple Mail Transfer Protocol (SMTP) credentials. Additionally, by default the configuration file will be overwritten during each publish processes.
Locate the environmentVariables line and open the dialog to add environment variables.
Enter the values for ASPNETCORE_ENVIRONMENT
and ConnectionStrings__umbracoDbDSN
.
Variable names need to change the object structure form JSON by combining the segments with double underscore __
For example: ConnectionStrings__umbracoDbDSN
Escaped backslashes \\
For example: serverName\\databaseInstanceName
are replaced by single backslash \
(DATABASESERVER123\SQL2017
)
Click Add.
Click Apply.
Restart IIS to apply the changes after updating the environment variables.
IIS can host .NET applications using two different hosting models: In-process (default) and Out-of-process.
This is the default hosting model and is more efficient, as there is no inter-process communication between IIS and the application.
No changes are required to your application configuration for in-process hosting. It works automatically with the default IIS settings.
This model is useful when you need to run a .NET application in a separate process, for example, when the application requires more isolated resources or needs to scale independently from IIS.
To enable out-of-process hosting:
Open your Umbraco project.
Locate the .csproj
file.
Add the following line:
Save the .csproj
file.
Rebuild your application.
Issue: A 405 error may occur when attempting to save content items in Umbraco, due to the WebDAV module blocking PUT requests.
Solution: If you encounter this issue, it may be because the WebDAV module in IIS is blocking the necessary PUT requests. This issue is not present on all IIS setups, but if you do have WebDAV installed, try disabling the WebDAV module.
Workaround:
Open the web.config
file.
Add the following code to remove the WebDAV module:
Restart IIS.
To deploy Umbraco to IIS via Azure DevOps, you can use the . This task is a wrapper for MSDeploy.exe
and can be configured as preferred.
runs the .NET application within the same process as the IIS worker process.
allows the .NET application to run separately from the IIS worker process. IIS acts as a reverse proxy to the Kestrel server, which hosts the .NET application.
Information on hosting Umbraco on IIS