Windows VPS & RDP

Install the.NET Hosting Bundle and run ASP.NET Core on IIS

Install the right.NET Hosting Bundle after IIS, restart IIS, publish your ASP.NET Core app and fix the common 500.x errors.

IntermediateWindows server2 min read

ASP.NET Core apps run behind IIS through the ASP.NET Core Module, which ships in Microsoft's .NET Hosting Bundle. The bundle also installs the.NET and ASP.NET Core runtimes, so it is the one download you need on a web server.

1. Install IIS first

The hosting bundle registers itself with IIS, so IIS must already be installed. If it is not, follow Install IIS and host a website and come back.

Note: If you install the bundle before IIS, run the bundle installer again afterwards and choose Repair.

2. Find the version your app needs

Check your project file for the target framework, for example <TargetFramework>net8.0</TargetFramework>. Install the hosting bundle for that major version. Several versions can be installed side by side.

3. Download and install the bundle

  1. On the server, open dotnet.microsoft.com, go to Download.NET, and choose your version.
  2. Under ASP.NET Core Runtime, download Hosting Bundle for Windows.
  3. Run the installer as Administrator.
  4. Restart IIS so it loads the new module:
PowerShell
net stop was /y
net start w3svc

4. Confirm what is installed

PowerShell
dotnet --list-runtimes

You should see Microsoft.AspNetCore.App and Microsoft.NETCore.App for your version.

5. Publish and host the app

  1. On your development PC, publish the app: dotnet publish -c Release -o./publish.
  2. Copy the publish folder to the server, for example to C:\inetpub\myapp (ways to copy files).
  3. In IIS Manager, open Application Pools, select your site's pool and set .NET CLR version to No Managed Code. ASP.NET Core runs in its own process, not the classic CLR.
  4. Point the site's physical path at C:\inetpub\myapp and browse to it.

Troubleshooting

  • HTTP Error 500.19 (0x8007000d): the ASP.NET Core Module is missing. Install or repair the hosting bundle, then restart IIS.
  • HTTP Error 500.30 / 500.31: the app failed to start or the right runtime is missing. Run the app's .exe from the publish folder in a terminal to see the real error, and compare with dotnet --list-runtimes.
  • Need to see logs: set stdoutLogEnabled="true" in the app's web.config temporarily and create the logs folder it points to.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.