3
votes

Hoping someone has some insight on problems with hosting .NET Core 2.0 apps in IIS

I'm trying to deploy my simple WebAPI project to IIS. Here are the steps I've taken:

  • Published to a folder.
  • Folder contains web.config
  • I start a new website in IIS
  • for the physical path, I choose the published folder from step 1 above
  • I have AspNetCoreModule installed on my machine. Confirmed this by clicking "Modules" in IIS for this newly created website
  • When visiting the URL, I get HTTP 404 errors.

enter image description here

Given that these steps to deploy to IIS is very different than what I've experienced for other .NET Framework apps I'm used to, I'm not sure why this is failing for me.

2
Why are you not using Deploy to IIS? Also, you say "I get HTTP 500" yet your image shows 404. As an FYI: WebAPI does not exist on ASP.NET CoreCamilo Terevinto
Trying to deploy to IIS on my local machine. All resources seem to suggest you should use publish to folder instead of deploy to IIS. youtube.com/watch?v=_Z1Lg7ssD8I as one exampleSteve Boniface
Well, they are incorrect. It's always better to use Web Deploy (i.e deploy to IIS). That way you don't have to do it manually and you can even determine which files are changedCamilo Terevinto
Okay. What do I configure to be my server? What about site name and URL? Is there documentation or tutorials on this? I've only been able to find resources that say use publish to a folder.Steve Boniface
@CamiloTerevinto I don't want to waste my time on the naming argument. If someone wants to call it "ASP.NET Core Web API" I don't think that's anything wrong. I just followed the convention this guy is using, and also Microsoft documentation uses similar terms.Lex Li

2 Answers

2
votes

This should be a comment but i don't have enough reputation.

I had had same issue and I have solved it in following way:

  1. Create folder (with application) on this path C:\inetpub\wwwroot
  2. On IIS create new web app with physical path on \wwwroot\yourapp

Make sure that you have installed "Internet Information Services Hostable Web Core" (you can add it in Windows Features)

0
votes

My problem was I needed two extra pieces of software:

  1. Windows server hosting (https://www.microsoft.com/net/download/windows)
  2. URL Rewrite Module