I recently published a .NET 8 Web API to IIS Windows server. At first I was getting errors showing “Failed to Load ASP.NET runtime”, which I resolved by installing ASP.NET Core Runtime 8.0.5 Windows Hosting Bundle. Then the API seemed to be working fine.
The next day I called the API again in Postman and now I’m getting 404 Not Found again!
I’ve done the following:
- project is working fine in debug on my dev pc.
- checked my domain is still pointing to the correct IP address
- re-started the Website/App pool in IIS
- re-started IIS
- checked Windows events but can’t see anything related.
- checked IIS log file, but it seems to be mostly empty.
How can I check if my requests are making it to the server? What is the best way to troubleshoot this?
Web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".SamadhiAPI.dll" stdoutLogEnabled="true" stdoutLogFile=".logsstdout" hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: b7f93657-cfc6-4b8d-91d7-33f7e9e4960b-->