Install the appropriate version of the .NET Core Hosting Bundle for .NET 8.0 on the production machine.
Requirements: Before starting the application publishing process, ensure you meet the minimum requirements and have the development environment installed. You can check the necessary tools in the installation guide.
When publishing an ASP.NET Core application for IIS deployment, use the following settings:
net8.0
Although you can target win-x64
, it is equivalent to Portable
when publishing from a Windows machine.
Instead, ensure the .NET Framework 8.0 runtime is installed on the production system.
The publication of the solution requires selecting the solution that contains all the publishing configurations.
For the Webadmin solution:
The publication of the solution requires selecting the solution that contains all the publishing configurations.
For the Application solution:
Security in Core is significantly stricter, and only HTTPS deployments are supported. Authentication and other security features may refuse connections if HTTPS is not enabled.
appsettings.json
To configure HTTPS behavior, modify the https_redirect
property in the appsettings.json
file:
none
: Disables HTTPS redirection for unsecured HTTP requests.redirect
: (Default) Replies with a 307 redirect code to HTTP requests.hsts
: Strictly enforces HTTPS. (Experimental setting)If your HTTPS port is not the default or if you have multiple port bindings, configure the port using the https_port
property.
ASP.NET Core does not natively use web.config
but relies on appsettings.json
. Some configurations have been routed to web.config
for retro-compatibility, but many are not observed by the application. The following sections are recognized in web.config
:
All other configurations are either only read by IIS or are ignored by the application.
Open IIS Manager:
Configure the Application Pool:
No Managed Code
. Integrated
. Create Separate Application Pools:
Webadmin
and App
.Elevate Privileges for Administration Portal:
Webadmin
) to run the Administration Portal with higher privileges.Creating a secondary website is highly recommended for better isolation and security, especially to keep all administration websites running on a different port. Although it’s not mandatory, it ensures enhanced security for your setup.
Note: Security in Core is significantly more strict, and only HTTPS deployments are supported.
To run the websites, you need to convert the website folders (the Visual Studio solution publish) into applications. Begin by converting the administration website (WebAdmin), and then proceed with each application.
C:\inetpub\wwwroot
Place the folders resulting from the Visual Studio publish process in this directory.
Setup the Administration Website (WebAdmin):
WebAdmin
.Setup Other Applications:
App
, follow the same instructions as above to add and configure the application.NOTE: Always confirm that the correct application pool is assigned for each website or application during the setup.
Open a web browser and in the address bar, type: https://<servername>.<certificate>/<sitename>
<servername>
: This is your IIS server name. If you didn’t create a secondary website or decided to use another port, use the port you selected. <sitename>
: Type the website name plus the word you gave for the administration portal.Another way to fing the url is in the IIS program. There is a button available to redirect you to the correct website:
NOTE: The first application to open should always be the Administrator Portal application!
Once the Administrative Portal is open, if you don't have any previous configuration (Configuracoes.xml
file), click on "Create System Configuration". If you already have an old configuration file, paste it into the WebAdmin publish folder.
If you wish to share the configurations made in WebAdmin across your applications, you need to place a file in each application to redirect the configuration location.
Configurations.redirect.xml
button to download the file.If all applications and the administration portal are installed on the same machine:
You can simply download the Configurations.redirect.xml
file and paste it in the application folder without any modifications.
If applications and the administration portal are installed on different machines:
Instead of using the Configurations.redirect.xml
, copy and paste the Configuracoes.xml
file directly into the respective folders after the main configurations.
After all configuration you can browse the application.