Skip to content
M

maui-dependency-injection

Guidance for configuring dependency injection in .NET MAUI apps

by dotnetFree

#4326in AI Skills
0In stores

Description

This agent skill gives guidance on dependency injection in .NET MAUI apps. .NET MAUI uses the same Microsoft.Extensions.DependencyInjection…

Highlights

  • Registration in MauiProgram.CreateMauiApp
  • Singleton, Transient and Scoped lifetimes
  • Constructor injection for pages and view models
  • Platform-specific services with #if

Ratings & Reviews

No ratings yet

Be the first to rate maui-dependency-injection.

People also visit

D

dependency-injection

Dependency injection patterns for .NET 10

AI Skills
Get
M

maui-app-lifecycle

.NET MAUI app lifecycle guidance

AI Skills
Get
M

maui-safe-area

.NET MAUI safe area and edge-to-edge layout guidance for .NET 10+

AI Skills
Get
M

maui-shell-navigation

Guide for implementing Shell-based navigation in .NET MAUI apps

AI Skills
Get
M

maui-data-binding

Guidance for .NET MAUI XAML and C# data bindings

AI Skills
Get
M

maui-theming

Guide for theming .NET MAUI apps

AI Skills
Get

maui-dependency-injection FAQ

Where are services registered?

In MauiProgram.CreateMauiApp, on builder.Services. The container is built once at startup.

How do I choose a lifetime?

The skill compares AddSingleton, AddTransient and AddScoped and explains which fits a given service.

How are platform-specific services handled?

They are registered with #if directives, so each platform gets its own implementation.

How do I install it?

Run npx skills add https://github.com/dotnet/skills --skill maui-dependency-injection in your project.

What are the best maui-dependency-injection alternatives?

Popular alternatives to maui-dependency-injection include dependency-injection, maui-app-lifecycle and maui-safe-area. See all maui-dependency-injection alternatives

Developer Stuff

Badges