Transient lifetime
A transient lifetime is a dependency-injection policy that creates a new service instance each time the service is requested or resolved.
ASP.NET Core in Action, 3e
A transient lifetime is a dependency-injection lifetime policy that creates a new service instance each time the service is requested.
- How it is used
- Uses transient registration for lightweight, mostly stateless services that should never be reused across dependency requests.
- How deep it goes
- Explains instance creation within dependency graphs, object volume, manual scopes, and lifetime safety, but stops short of container internals.
- Examples
- Demonstrates unique DataContext and Repository instances through AddTransient registrations, RowCount values, an endpoint handler, and repeated API calls.
- What you can do after
- Operate/configure it through ASP.NET Core AddTransient registrations and diagnose incorrect root-container resolution or lifetime capture.
Read how ASP.NET Core in Action, 3e explains transient lifetime →
.NET MAUI in Action
A transient scope is a dependency-injection lifetime in which a new service instance is created each time the service is requested.
- How it is used
- Registers pages and view models that should be newly created whenever dependency injection resolves them.
- How deep it goes
- Explains lifetime trade-offs, navigation expectations, state concerns, and the AddTransient registration step.
- Examples
- Demonstrates transient registration with LoginPage in MauiProgram.cs and compares it with Shell-managed pages and singleton services.
- What you can do after
- Operate/configure .NET MAUI dependency injection by registering a page with AddTransient and selecting lifetimes by navigation and state needs.
Also covered in
Related concepts
- ASP.NET Coreused by · ASP.NET Core is Microsoft's open-source, cross-platform framework for building web applications and services on .NET.
- servicekind of · A service is an application component that provides a defined capability to other components, typically through an interface.
- service lifetimekind of · A service lifetime is a dependency-injection rule that determines when service instances are created, how long they are retained, and when they are disposed.
- dependency graphproduces · A dependency graph is a graph whose nodes represent entities and whose edges represent dependency relationships among them.
- Invoke methodused by · Invoke is the conventional ASP.NET Core middleware method that processes an HTTP request and can receive dependencies through its parameters.
Questions about transient lifetime
What is transient lifetime?
A transient lifetime is a dependency-injection policy that creates a new service instance each time the service is requested or resolved.
Which Manning books explain transient lifetime?
ASP.NET Core in Action, 3e and .NET MAUI in Action.
What is transient lifetime a kind of?
Transient lifetime is a kind of service. A service is an application component that provides a defined capability to other components, typically through an interface.
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.

