Hosting DotNet Core Web Application on Windows Server (IIS8)

So finally I get around to this.. Sorry to keep anyone waiting but when life knocks at the door well you simply have to answer it. (It’s like that uninvited guest that comes to your house when you have the lights on and you just hope that you can pretend you aren’t at home resulting in them leaving without question hahah \(^_^)/ yay!! )

Let’s get to it! So if you are a true programmer all your tooling will be requiring massive updates because we only stay elite when bashing our heads on the desk solving issues that have already been solved right!! Correct!!  (-_-)

So if you haven’t already kept up with the latest tech get Visual Studio updated with the latest tooling. There is no shame in being elite at being behind.


Check out the available updates at

So I’m assuming that we all know how the process for creating a new web application within Visual Studio if you are reading this post. If not I have linked this to some other awesome blog post.

Some new selections will be the ability to create a new ASP.NET Core Web Application (.Net CORE). This is our focus. Create a new project and select the Web Application Template.


Un-select Host in the Cloud – We aim to host on Windows Server.

There are few things we need to create to get our site up and hosted by IIS8 within our Windows Server.

  • Microsoft DotNet Core Windows Server Hosting
  • Web Application on WebServer
  • Publishing Profile
  • Minor Tweaks to appSettings.Json

Out of the box appSettings.json should look something like the following


    "IntrumentationKey": {"0f723b60-5b54-4105-938d-c49eec544f7"
    "Logging": {
    "LogLevel": {

Install Hosting Bundle



Change Application Pool Settings:



Navigate back to Visual Studio and Right-Click your web application project and select publish.


Here import the configured settings created from IIS when creating your website.


After importing your settings and validating the  connection you should see the Settings page



Hitting Preview is great if you really wish to see the changes that will occur without officially publishing.  (It’s along the lines of a “whatIf” if you are familiar with msbuild options)

If you have followed up to this point you should be presented with this awesome message -_-


Well that’s the little tad bit that was not told to us to host the app within IIS8 on Windows Server 2012. So what exactly do we have to do? Well first head bang into some dry wall. That always fixes it! Ok really there are some settings that have to be configured for our app to respond given how dotnet works. A great article is already written on this and really the guy (Rick Strahl) is way better versed at explaining this. Take a look at IIS and Asp,NET Core work here.



gcServer vs System.GC.Server Issues with different variants – Actual Documentation on appsettings.json –

Very Simple Event log for the application:

Log Name: Application
Source: IIS AspNetCore Module
Date: 10/12/2016 4:58:42 AM
Event ID: 1000
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: NikolaT
Failed to start process with commandline '"dotnet" .\WebApplication1.dll', ErrorCode = '0x80070002'.
Event Xml:
<Event xmlns="">
 <Provider Name="IIS AspNetCore Module" />
 <EventID Qualifiers="0">1000</EventID>
 <TimeCreated SystemTime="2016-10-12T04:58:42.000000000Z" />
 <Security />
 <Data>Failed to start process with commandline '"dotnet" .\WebApplication1.dll', ErrorCode = '0x80070002'.</Data>

Simply means you need the Runtime also on the server along with the hosting bundle. Ugh headache achieved. I mean what is the point of adding the hosting bundle if I still cannot run my app. Lol really!!


Further Reading – References (Kertrel)

0 comments on “Hosting DotNet Core Web Application on Windows Server (IIS8)Add yours →

Leave a Reply

Your email address will not be published. Required fields are marked *