ASP.NET Core and .NET in Plesk

The server has .NET runtimes from 3.1 to 10 installed. There is no SDK on the hosting — you build the application on your own computer and upload the finished publish output.

Publishing

  1. On your computer, run in the project folder: dotnet publish -c Release. The target .NET version must be within 3.1–10.
  2. Take the contents of the publish folder (usually bin\Release\<version>\publish) — it contains web.config, the application DLLs and appsettings.json.
  3. Upload these files directly to the site root httpdocs via FTP or File Manager.
  4. Open the site in a browser.

Publish files must be directly in httpdocs, not in a subfolder (such as httpdocs/publish). Otherwise the server cannot find the application's web.config and returns error 403.14.

Changed appsettings.json? Recycle the pool

.NET reads appsettings.json only at startup. After editing the file, open the Hosting & DNS tab, Dedicated IIS Application Pool for Website, and click Recycle — the application restarts with the new settings. More in IIS application pool.

The Recycle button restarts the application
The Recycle button restarts the application

The application does not start: how to see the error

  1. In web.config in the site root, set stdoutLogEnabled="true" on the aspNetCore element (path stdoutLogFile=".\logs\stdout").
  2. Create a logs folder in httpdocs — the log is not written without it.
  3. Open the site again and check the file in the logs folder: it contains the startup exception.
  4. Fix the error and be sure to set stdoutLogEnabled="false" again — otherwise the logs keep growing.

ASP.NET Core needs the site's application pool to run in No Managed Code mode. If right after deployment the site returns an empty 500 error with no text, contact support and ask to switch the site's pool to No Managed Code.

Common mistakes

  • 403.14 — files are in a subfolder instead of httpdocs.
  • Empty 500 right after the first upload — the pool mode, see above.
  • 500.30 / startup failure — read the stdout log; a frequent cause is a wrong database connection string (see MS SQL).
  • New settings have no effect — the pool was not recycled.
Questions and answers
No, the SDK is not installed on the hosting. Build with dotnet publish -c Release on your computer and upload the output.
Runtimes from .NET Core 3.1 to .NET 10. Publish your application for one of them.
Recycle the application pool so the application restarts.