This is the second project I have updated from ASP.Net Core 2.2 to 3.1. The first one runs fine. The second one runs fine in Visual Studio (2019), but when you publish it and run it from dotnet CLI the console just hangs indefinitely, no output in the console and I have enabled stdout and the output file is zero bytes.
The solution is hosted within IIS and when I try and run it through IIS I get the following entries in the application event log:
Application '/LM/W3SVC/2/ROOT' with physical root 'D:\wwwroot\InclusionService_UAT\' failed to start process with commandline 'C:\Program Files\dotnet\dotnet.exe .\InclusionService.Web.dll' at stage 'PostStartCheck', ErrorCode = '0x8027025a', assigned port 12973, retryCounter '1'.
and
Application '/LM/W3SVC/2/ROOT' with physical root 'D:\wwwroot\InclusionService_UAT\' failed to start process with commandline 'C:\Program Files\dotnet\dotnet.exe .\InclusionService.Web.dll' with multiple retries. Failed to bind to port '35033'. First 30KB characters of captured stdout and stderr logs from multiple retries: nothing more shown
This is my Program.cs which I have exactly the same in my other migrated solution:
public static void Main(string[] args)
{
var builder = new HostBuilder()
.ConfigureWebHostDefaults(opt =>
{
opt.UseStartup<Startup>();
opt.UseIISIntegration();
});
var host = builder.Build();
host.Start();
}
It would be much easier to debug if there was some output, but there's nothing to go on.
ConfigureServices()
andConfigure()
methods in Startup.cs and both times the exception is displayed in the console output which leads me to believe the service registrations are ok ... – Jason GoodwinHTTP Error 502.5 - ANCM Out-Of-Process Startup Failure
error. – Jason Goodwin