When trying to publish a new project in .NET 8 I get the error:
Error : RuntimeIdentifier is required for native compilation. Try running dotnet publish with the -r option value specified.
I found the cause was because the default template for creating a ASP.NET Core Web API (native AOT) uses CreateSlimBuilder in the Program.cs file. This is made for AOT and has no support for IIS (which I need), so I switched back to the old CreateBuilder