Deploying .NET 11 Applications via Plesk Print

  • net11, dotnet 11, deploy, self-contained, plesk, web.config
  • 0

Overview

This guide explains how to deploy a .NET 11 (ASP.NET Core 11) application to your Windows hosting account using Plesk. On our servers, .NET 11 apps are published as self-contained: the .NET 11 runtime is included in your publish folder, so your app runs without anything being installed on the server.

Before You Begin

Make sure your application is:

  • Targeting net11.0 in your .csproj
  • Built and tested locally with the .NET 11 SDK
  • Published as self-contained for win-x64 (steps below)

Step 1: Publish Your Application as Self-Contained

Option A: Command Line

dotnet publish -c Release -r win-x64 --self-contained true -o ./publish

This creates a publish folder with your app, the .NET 11 runtime, and a web.config for IIS.

Option B: Visual Studio

  1. Right-click your project and choose Publish
  2. Choose your target (Folder, FTP or Web Deploy)
  3. Click Show all settings
  4. Set Deployment mode to Self-contained
  5. Set Target runtime to win-x64
  6. Save the profile and click Publish

Option C: Set It in the Project File

If you want every publish to be self-contained, add these lines to your .csproj:

<PropertyGroup>
  <TargetFramework>net11.0</TargetFramework>
  <RuntimeIdentifier>win-x64</RuntimeIdentifier>
  <SelfContained>true</SelfContained>
</PropertyGroup>

Step 2: Check the web.config

A self-contained publish writes a web.config that starts your app's own .exe instead of dotnet. It looks like this (with your app's name):

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath=".\MyApp.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
    </system.webServer>
  </location>
</configuration>

Keep this file as your publish produced it. If processPath says dotnet and arguments names a .dll, the app was published framework-dependent and will not start for .NET 11 yet. Publish again as self-contained.

Step 3: Upload Your Files

If the site is already running, upload a file named app_offline.htm to the site root first. IIS then stops the app so its files are not locked while you copy. Delete app_offline.htm when the upload is finished.

Option A: Plesk File Manager

  1. Log in to Plesk
  2. Go to Websites & Domains
  3. Click File Manager for your domain
  4. Open your web root (usually httpdocs)
  5. Upload everything from your publish folder (you can upload a ZIP and extract it in File Manager)

Option B: FTP

  1. Connect with your FTP credentials from Plesk
  2. Open /httpdocs or your document root
  3. Upload everything from your local publish folder

Option C: Web Deploy from Visual Studio

Use the Web Deploy publish profile for your site, with Deployment mode set to Self-contained and Target runtime set to win-x64 as in Step 1. See the Deployment & Publishing section of the knowledge base for setting up the profile.

Step 4: Restart the Application

No runtime setting is needed in Plesk for a self-contained app; you do not need to change anything on the domain's .NET Core page. To make sure the new version is loaded, recycle the application pool:

  1. Go to Websites & Domains
  2. Open your domain
  3. Click Dedicated IIS Application Pool
  4. Click Recycle

Step 5: Verify Your Application

  1. Visit your domain in a web browser
  2. Check that the application loads and the key pages work
  3. If you see an HTTP 500.3x error, see Troubleshooting .NET 11 Application Errors

Important Notes

  • A self-contained publish is larger than a framework-dependent one because it includes the runtime, so it uses more of your plan's disk space.
  • Microsoft releases .NET 11 patch updates (11.0.x). A self-contained app keeps the runtime it was published with, so republish with the latest SDK to pick up security fixes.
  • The environment is Production by default. Put production settings in appsettings.Production.json.
  • Once the shared .NET 11 runtime is added to our servers, framework-dependent publishing will work too. Your self-contained app keeps working either way.

Official documentation: What's new in .NET 11

Looking for a host for your .NET 11 app? Our .NET 11 hosting plans run on Windows Server 2022 with IIS 10 and Plesk. Compare plans.

Was this answer helpful?

« Back