For .NET 8, there is no need to use Startup.cs. You can embed swagger into Program.cs. Refer to this answer for more details - .NET8 Blazor and Swagger UI