Plesk and Windows

How to deploy an ASP.NET site on Plesk Windows hosting

Publish from Visual Studio using the Web Deploy settings file from Plesk, or build a publish folder and upload it by FTP or File Manager. Then check the .NET settings in Plesk and that web.config matches your app.

Updated 3 min readApplies to: Plesk

When to use this

Use this guide if you already have a Windows hosting account with ODHOST, running the Plesk control panel on IIS, and want to put an ASP.NET Web Forms or MVC app (.NET Framework) or an ASP.NET Core app on it. If you are unsure whether you need Windows at all, read Linux vs Windows hosting.

Need Windows hosting? Windows hosting is not one of ODHOST's standard plans. It is arranged by contacting ODHOST with your requirements.

ODHOST note: Installed .NET Framework and ASP.NET Core versions, Web Deploy availability, and which database engines your plan offers are not published. Confirm them by ticket before you start, and target a version the server has. Microsoft's .NET support policy lists which versions still get updates.

Prepare your app

  1. Confirm the target framework with support and set it in your project (<TargetFramework> in the .csproj).
  2. Move secrets and connection strings out of source code into appsettings.Production.json or web.config settings you control.
  3. Choose framework dependent or self contained deployment. Framework dependent needs the matching runtime on the server; self contained bundles it, but IIS still needs the ASP.NET Core Module.

Option 1: publish from Visual Studio with Web Deploy

  1. Log in to Plesk and open Websites & Domains for your domain. Menus vary by Plesk version and host configuration.
  2. Enable Web Deploy publishing in the domain's hosting settings if it is not already on, if your plan allows it.
  3. Download the Web Deploy Publishing Settings file for the domain.
  4. Open your project in Visual Studio, right click it in Solution Explorer and choose Publish.
  5. Choose Import Profile and select the downloaded .publishsettings file.
  6. Enter the password (the file normally does not include it) and click Validate Connection.
  7. Set Configuration to Release and, for ASP.NET Core, the target framework and deployment mode.
  8. Click Publish and watch the Output window for errors.

Option 2: build locally and upload

  1. Build a publish folder:

    dotnet publish -c Release -o .\publish
    

    For .NET Framework projects, use Visual Studio's Folder publish target.

  2. Upload app_offline.htm to the site root (usually httpdocs) to stop the running app and release its files.

  3. Upload the contents of the publish folder with FTP or Plesk File Manager. See uploading files with File Manager or FTP for FTPS settings.

  4. Delete app_offline.htm to bring the site back.

Set .NET options in Plesk

  1. Open the domain's ASP.NET Settings (for .NET Framework apps) and check the framework version and settings.
  2. Check the domain's hosting settings for the handler and application pool options your app needs. For ASP.NET Core, the app pool's .NET CLR setting is normally "No Managed Code", because the app runs in its own runtime.
  3. Recycle the application pool after major changes if your plan exposes that option.

web.config basics for ASP.NET Core

dotnet publish generates this file. A typical in process version looks like this:

<?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="dotnet" arguments=".\MyApp.dll"
                  stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout"
                  hostingModel="inprocess">
        <environmentVariables>
          <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Production" />
        </environmentVariables>
      </aspNetCore>
    </system.webServer>
  </location>
</configuration>

For a self contained app, processPath points at .\MyApp.exe and arguments is empty. To see startup errors, create a logs folder, set stdoutLogEnabled="true", reproduce the error, read the log, then set it back to false.

How to confirm it worked

  • The site loads over HTTPS and key pages return status 200.
  • Plesk logs show no new errors after a few visits.
  • Database actions such as login or saving a form work.

If it still fails

Open a support ticket with the domain, the framework and version you targeted, deployment mode, the exact error (for example HTTP Error 500.30), stdout log lines, and the Visual Studio Output text if Web Deploy failed. Never include passwords or connection strings. For larger .NET workloads, contact ODHOST to discuss the resources your application needs.

Frequently asked questions

Which .NET versions are installed on my ODHOST Windows hosting?

ODHOST does not publish the installed .NET Framework or ASP.NET Core runtimes. Open a ticket and confirm the exact versions before you deploy, and target one of those.

I do not have Windows hosting yet. How do I get it?

Windows hosting is not one of ODHOST's standard plans. Contact ODHOST with your application's .NET version, database engine and expected traffic, and the team will advise on an arrangement.

Should I publish framework dependent or self contained?

Framework dependent is smaller and uses the runtime installed on the server, so it only works if that runtime is present. Self contained bundles the runtime, but on IIS the ASP.NET Core Module must still be installed on the server.

Why do I get HTTP Error 500.30 or 500.19?

500.30 usually means the app crashed on start, often a missing setting or connection string. 500.19 means web.config is invalid or uses a module the server does not have. Turn on stdout logging briefly to see the cause.

Why does Web Deploy say files are locked?

The running app holds its DLLs open. Visual Studio can take the app offline during publish; when uploading by FTP, place an app_offline.htm file in the site root first, then remove it.

Sources and further reading

Contact us