Reputation: 38019
I am publishing an app to my self hosted iis server.
I then run the app with dotnet myapp.dll and the app runs correctly.
However, when I turn on IIS and try to access the site, all static files show properly, but the API calls return 404 not found.
This is the request. Note that it is an options call. Do I need to configure something in the API to handle those? (I just tried on a different computer, and it showed it as a GET, not OPTIONS, but same 404 error.
OPTIONS /api/Entity/list-active HTTP/1.1
Host: greggum.com
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
Access-Control-Request-Method: GET
Origin: http://96.254.154.55
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Access-Control-Request-Headers: content-type
Accept: */*
Referer: http://96.254.154.55/
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Upvotes: 3
Views: 1449
Reputation: 6408
Have you followed the Publishing to IIS docs?
Particularly the .NET Core Windows Server Hosting bundle that has to be installed.
Also, note that unlike a standard ASP.NET application, you'll be running a Unmanaged Application Pool.
Upvotes: 2