15 11 2016
Running ASP.NET Core applications on IIS
Preparing for CodeCamp Cluj 2016 I needed to host one ASP.NET Core application on IIS web server. I had one simple box with clean IIS available in my network and I installed my ASP.NET Core application on it. This blog post is simple step by step guide showing how to prepare and configure IIS for ASP.NET Core applications.
I started with knowledge that when publishing ASP.NET Core application to Azure then all the work is done for me and I have nothing additional to do. I also know that for IIS reverse proxy is used to communicate with Kestrel. So, I expected at least some work with vanilla IIS. But it was all easier than I thought.
Configuring IIS and publishing ASP.NET Core application
Create new host on IIS and make sure it is accessible.
Download and install .NET Core Windows Server Hosting package.
Run the following commands on elevated command prompt:
net stop was /y
net start w3svc
Change basic settings of application pool and set .NET Framework version (or .NET CLR version) to “No managed code”.
Make sure that Program.cs file of ASP.NET Core application looks similar to this:
public class Program
public static void Main(string args)
var host = new WebHostBuilder()
.UseIISIntegration() // IMPORTANT!!!
Publish application to some folder and move published files to IIS host folder using copy and paste.
It was all I had to do to make my ASP.NET Core application run on IIS. I used simple and primitive copy-paste deployment over Remote Desktop to get published files from local folder to IIS web host folder.
For more information and troubleshooting tips there is official page Publishing to IIS available.