'ASP.Net Core Web API in IIS

I'm trying to add an API to IIS. The API (via Swagger) runs fine locally. To rule out anything in my API I built the basic Weather API one and I get the same error.

App Log:

Application '/LM/W3SVC/1/ROOT/WeatherAPI' with physical root 'C:\inetpub\wwwroot\Weather' failed to load coreclr. Exception message: CLR worker thread exited prematurely

Application '/LM/W3SVC/1/ROOT/WeatherAPI' with physical root 'C:\inetpub\wwwroot\Weather' hit unexpected managed exception, exception code = '0xe0434352'. Please check the stderr logs for more information.

Error 0xe0434352 is so generic as to be of no use.

I see others have had similar issues (some of which are on StackOverflow) but none resolve the issue.

It's being published as: Release/.Net 6.0/Self-Contained/win-x64.

The AppPool is "No Managed Code"/Integrated Pipedline.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source