-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Open
Labels
Priority:3Work that is nice to haveWork that is nice to havearea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-minimal-hosting
Milestone
Description
HostBuilder adds some default services in CreateServiceProvider() that are not added to WebApplicationBuilder.Services until after build.
var builder = WebApplication.CreateBuilder();
// System.InvalidOperationException: No service for type IHost has been registered.
builder.Services.BuildServiceProvider().GetRequiredService<IHost>();
Before #34455 was merged, these services never showed up in WebApplicationBuilder.Services even after build. Because CreateServiceProvider() is called in HostBuilder.Build(), we cannot access these service descriptors any earlier without new public API.
Metadata
Metadata
Assignees
Labels
Priority:3Work that is nice to haveWork that is nice to havearea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-minimal-hosting