ASP.NET Core–IIS gives 502.5
Running .net core apps on IIS can be a tricky if not done correctly.
In order to be sure you will need to wait up to 6 minutes for IIS to time out to get the true error message.
Here are some quick tips
- Make sure the IIS user has access to the folder where the published files are
- The application pool serving the asp.net core website should have CLR = no managed code
- In your code, ensure that UseUrls comes BEFORE UseIISIntegration
While running it in development is straightforward using the UseUrls function, if it appear after UseIISIntegration, it will override the IIS setup and your website will not work, what is worse is that you will have to wait a full 6 minutes before you see the actual error