How to Deploy an ASP.NET Application on IIS

This guide covers deploying a published ASP.NET (Core or Framework) application to IIS on a Windows VPS, including the required hosting components.

Prerequisites

  • IIS installed on the VPS
  • Administrator access
  • A published ASP.NET application ready to deploy

Step 1 — Install the .NET Hosting Bundle (For ASP.NET Core)

Download the ASP.NET Core Hosting Bundle from Microsoft's official .NET download page, matching your application's target version, and run the installer on the server.

iisreset

Restarting IIS after installation ensures the new module is loaded.

Step 2 — Create the Application Directory

New-Item -Path "C:\inetpub\myapp" -ItemType Directory

Step 3 — Transfer Your Published Files

Copy your application's published output (from dotnet publish or Visual Studio's Publish feature) to the server — via RDP file copy/paste, or a file transfer tool.

Step 4 — Create an Application Pool

For ASP.NET Core, use No Managed Code since it runs its own runtime:

New-WebAppPool -Name "MyAppPool"
Set-ItemProperty IIS:\AppPools\MyAppPool -Name managedRuntimeVersion -Value ""

For ASP.NET Framework applications, select the appropriate .NET CLR version instead.

Step 5 — Create the Website in IIS

New-Website -Name "MyApp" -PhysicalPath "C:\inetpub\myapp" -ApplicationPool "MyAppPool" -Port 80

Step 6 — Set Folder Permissions

Grant the application pool identity read access to the app folder:

icacls "C:\inetpub\myapp" /grant "IIS AppPool\MyAppPool:(OI)(CI)RX"

Step 7 — Test the Application

http://YOUR_SERVER_IP

Step 8 — Configure a Custom Domain Binding

New-WebBinding -Name "MyApp" -Protocol http -Port 80 -HostHeader "yourdomain.com"

Step 9 — Enable HTTPS

See How to Install an SSL Certificate on IIS to add a secure binding.

Viewing Application Logs

ASP.NET Core stdout logging can be enabled in web.config:

<aspNetCore processPath="dotnet" arguments=".\MyApp.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />

Common Errors

"HTTP Error 502.5 - Process Failure" — usually means the .NET Hosting Bundle isn't installed, or the application failed to start; check the stdout log for the specific exception.

"HTTP Error 500.19" — a web.config configuration error; the detailed error page identifies the exact module/section at fault.

App works locally but not on the server — check for missing environment-specific configuration (connection strings, environment variables) not included in the published output.

Best Practices

  • Use a dedicated application pool per application for isolation
  • Enable HTTPS for production deployments
  • Store secrets/connection strings outside the deployed code where possible, using environment variables or a secure configuration provider

FAQ

Do I need Visual Studio installed on the server?
No — only the ASP.NET Core Hosting Bundle (for Core apps) or the appropriate .NET Framework version is required on the server; publishing happens on your development machine.

Related Articles

  • How to Install IIS on a Windows VPS
  • How to Install an SSL Certificate on IIS
  • How to Install SQL Server on a Windows VPS
  • asp.net, iis deployment, dotnet hosting bundle, windows server
  • 0 A felhasználók hasznosnak találták ezt
Hasznosnak találta ezt a választ?

Kapcsolódó cikkek

How to Connect to a Windows VPS via Remote Desktop (RDP)

Remote Desktop Protocol (RDP) provides full graphical access to a Windows Server VPS, letting you...

How to Secure RDP on a Windows VPS

RDP's default configuration (standard port, password authentication, unlimited login attempts)...

How to Create a New Administrator User on Windows Server

Using only the built-in Administrator account for all management tasks is risky. Creating a...

How to Install Windows Updates on a Windows VPS

Keeping Windows Server updated is essential for security and stability. This guide covers...

How to Configure Windows Firewall on a Windows VPS

Windows Defender Firewall controls which network connections are allowed to and from your server....