Search code examples
.netvisual-studiovisual-studio-2022.net-8.0

HTTP Error 500.37 - ASP.NET Core app failed to start within startup time limit


When deploying a new .net 8 project to a windows 2022 server and within IIS, I get this error when trying to launch it:

HTTP Error 500.37 - ASP.NET Core app failed to start within startup time limit


Solution

  • I found the cause was because I accidentally created this api using the ASP.NET Core Web API (native AOT) template that uses CreateSlimBuilder in the Program.cs file. CreateSlimBuilder is for AOT and has no support for IIS. I switched it to the old CreateBuilder, built and re-published and now it works.