Asp.Net
How to publish ASP.NET Core to Plesk (IIS + ASP.NET Core Module)
- 236
- por Net Asp Hosting - Support Blog
- Publicado 9/12/2025
Do you need to publish your ASP.NET Core application to Plesk using IIS and the ASP.NET Core Module (ANCM)? This tutorial will guide you step-by-step through the deployment process, whether you are using the runtime installed on the server or a self-contained application.
What you need to know before starting
Plesk uses IIS as its web server.
ASP.NET Core applications run via the AspNetCoreModuleV2 (ANCM).
You can publish the application in two modes: Framework-Dependent (uses the .NET runtime installed on the server) or Self-Contained (includes the runtime within the application).
Step 1: Generating the application for publication
In your development environment (Visual Studio, Rider, or CLI), generate the publication files in Release mode.
In the terminal, the command is:
dotnet publish -c Release
This command creates a folder named `publish` inside `bin/Release` containing the files that need to be uploaded to the server.
Step 2: Uploading files to Plesk
Log in to Plesk and navigate to the desired domain.
Enter the File Manager and open the `httpdocs` folder. Upload the entire contents of the `publish` folder.
Alternatively, you can upload the files via FTP or SFTP using a client like FileZilla.
Step 3: Creating the web.config file
At the root of the `httpdocs` folder, create a file named `web.config` containing the following:
Replace `MinhaAplicacao.dll` with the actual name of your ASP.NET Core project`s main DLL.
Step 4: Creating the logs folder
Create a folder named `logs` inside `httpdocs`. This folder will be used to record errors and messages from the ANCM module, which are useful if the application fails to load.
Ensure that the Application Pool user has write permissions for this folder. Step 5: Publishing in Self-Contained mode (optional)
If you want to deploy the application with the runtime bundled in (without relying on the version installed on the server), publish it like this:
dotnet publish -c Release -r win-x64 --self-contained true
In this mode, the `processPath` in the `web.config` must point to the application`s `.exe` file:
Step 6: Configuring environment variables (optional)
If your application uses variables such as `ASPNETCORE_ENVIRONMENT`, these can be configured in Plesk under:
Websites & Domains > Button: .NET Core > Environment variables
Or directly in the `web.config`:
Step 7: Testing the application
Access the domain via your browser.
If a 500.30 or 500.31 error occurs, check the files inside the `logs` folder. They usually indicate issues such as:
Incompatible .NET version
Insufficient permissions
Failure to load dependencies
Application startup failure
Wrapping up
Done! Your ASP.NET Core application is now published on Plesk with IIS using the `AspNetCoreModuleV2` module.
