title: ASP .NET Core 3 + Identity Server issue with in-process and out-of-process hosting
body: <p>We're currently trying to upload two ASP .NET Core 3 simple web applications.</p>
  
  <p>One is an IdentityServer4 application which generates tokens, while the other has some APIs endpoints, and relies on the first one for the authentication.</p>
  
  <p>Our need is to publish them both under the same application pool where there are other applications, since we have an https certificate. We've already installed the asp net core 3 hosting kit.</p>
  
  <p>Uploading just one, the authentication application, works fine. Uploading them both generates, when accessing the second, the error <strong>500.35 ANCM Multiple In-Process Applications in same Process</strong>. <a href="https://docs.microsoft.com/it-it/aspnet/core/test/troubleshoot-azure-iis?view=aspnetcore-3.0" rel="nofollow noreferrer">This error's description is quite clear</a> (seems like we can't host two in-process apps in the same pool), so we tried to configure both apps as OutOfProcess, by adding the following line to our .csproj files</p>
  
  <pre><code>&lt;AspNetCoreHostingModel&gt;OutOfProcess&lt;/AspNetCoreHostingModel&gt;
  </code></pre>
  
  <p>From what i read, this should interpose a Kestrel web server between our IIS and the caller. But now, for both of them, the error we get is <strong>502.5 - ANCM Out-Of-Process Startup Failure</strong>.</p>
  
  <p>I've found no log anywhere, aside from the Window's event log, which reports this failure:</p>
  
  <p><em>Application '/LM/W3SVC/1/ROOT/XXXXX' with physical root 'C:\inetpub\wwwroot\XXX\' failed to start process with commandline 'dotnet .\XXXXXXXXX.dll' with multiple retries. Failed to bind to port '10352'. First 30KB characters of captured stdout and stderr logs from multiple retries:</em></p>
  
  <p>and nothing more.</p>
  
  <p>Any idea would be really appreciated at this point. :)</p>
  
  <p>Thanks everybody and have a nice day.</p>