I have run into this error a few times and I always spend 40 minutes remembering (or re-figuring out) what the issue ACTUALLY is and what I need to do to fix it.
I may be the only person that suffers from this - because I may have done somethign I should not have. For the record.
ASP.NET Core was running in non-managed application pool on IIS. So you could have more than one app in a single application pool. Whether that's good or bad is not for this post nor to be considered. It is what it is.
But, once you go to ASP.NET Core 2.2 (and 2.1?) and use InProcess (which is by all accounts better_ then you run into errors because it expects one app per application pool.
the error is:
HTTP Error 500.0 - ANCM Out-Of-Process Handler Load Failure
Also, if it's an existing app, it also requires a setting in the config.
Read's Strah's article fo rmore info and remember the app pool.
https://weblog.west-wind.com/posts/2019/Mar/16/ASPNET-Core-Hosting-on-IIS-with-ASPNET-Core-22