IServiceCollection
IServiceCollection is a .NET interface representing service descriptors and registrations used to configure a dependency-injection container.
ASP.NET Core in Action, 3e
IServiceCollection is the ASP.NET Core abstraction representing the collection of service registrations available to an application.
- How it is used
- Registers framework and application services that ASP.NET Core’s dependency-injection container must provide at runtime.
- How deep it goes
- Explains registration, extension methods, dependency resolution, and the Build boundary without detailing container internals.
- Examples
- Uses AddHttpLogging(), AddRazorPages(), custom services, and the Build() boundary as concrete examples.
- What you can do after
- Apply it via WebApplicationBuilder.Services to register framework features and application dependencies before building the app.
Read how ASP.NET Core in Action, 3e explains IServiceCollection →
Building Web APIs with ASP.NET Core
A service collection is a registry of application services and their dependency-injection configurations.
- How it is used
- Registers the main gRPC services in Program.cs before they enter the HTTP pipeline.
- How deep it goes
- Shows one registration call but does not descend into the collection’s internals or dependency-injection resolution process.
- Examples
- Uses builder.Services.AddGrpc() alongside app.MapGrpcService<GrpcService>() in the application startup configuration.
- What you can do after
- Operate/configure a gRPC server by registering its framework services in the application startup pipeline.
Read how Building Web APIs with ASP.NET Core explains IServiceCollection →
Related concepts
- dependency injectionused by · Dependency injection is a software design technique in which a component receives its dependencies from outside rather than creating or locating them internally.
- services propertyincludes · The Services property is a WebApplicationBuilder property exposing the service collection used to register application and framework dependencies for dependency injection.
- ServiceRegistryincludes · ServiceRegistry is Lamar's service-registration type for configuring registered services and their dependencies.
- constructor injectionused by · Constructor injection is a dependency-injection technique that supplies an object's required dependencies through its constructor when the object is created.
- HostBuilderused by · HostBuilder is a .NET hosting API type that configures and constructs an application host.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

