After switching one of our ASP.NET Core applications from out-of-process hosting to InProcess hosting, we got the following error message:
This is caused by the fact that we are running multiple applications in IIS in the same application pool. As long as we were running out-of-process this was not an issue. But when we switched to InProcess hosting it turned out that you cannot run multiple In-Process applications in the same application pool.
The solution is simple, give each application its own app pool.