Last post Feb 04, 2021 02:44 AM by DA924
Feb 03, 2021 05:38 PM|bmacp|LINK
I've been trying to get the VS WebAPI sample WeatherForecast working on our IIS server for a while now. Running it from VS 2019 and testing with Postman works fine on my dev machine localhost. As a complicating factor, there is a reverse proxy on the server
so I'm not sure how that is effecting this situation.
The 5.0.2 hosting bundle is installed on the server.
Application pool is "No managed code".
Windows Server 2012 R2 version 6.2 build 9200.
IIS version 8.5.9600.16384
Test: trying to "Browse Website" from within IIS manager
Error: The device or resource (cohegis.houstontx.gov) is not set up to accept connections on port 5000
The bindings are set to ports 5000 and 5001. I didn't know what to set these to.
Test: trying from Postman GET https://cohegis.houstontx.gov/WeatherForecast
Error: 503 Service Unavailable
Test: trying the reverse proxy from Postman
Error: 404 - File or directory not found.
For debugging purposes, I tried to get logging to work but that didn't happen. I set write permissions on the logs folder to my application pool.
<?xml version="1.0" encoding="utf-8"?>
<location path="." inheritInChildApplications="false">
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
<handlerSetting name="debugFile" value=".\logs\aspnetcore-debug.log" />
<handlerSetting name="debugLevel" value="FILE,TRACE" />
Any thoughts on what to try next?
Thanks for the help.
Feb 03, 2021 09:18 PM|mgebhard|LINK
You probably need to set a firewall rule to allow posts 5000 and 5001. See your firewall docs.
Feb 04, 2021 02:02 AM|bruce (sqlwork.com)|LINK
As you are using the iis hosting module in process mode, the ports are set by iis configuration, not asp.net core. Typically that would be port 80 and 441
Feb 04, 2021 02:44 AM|DA924|LINK
You could deploy to local IIS on your development machine the same IIS that's running on a server machine as a test.
You can also just take IISExpress out the picture and use local IIS for ASP.NET code development and debugging against local IIS.
Enable debugging for ASP.NET apps - Visual Studio | Microsoft Docs