Skill / SKILL.md

Maui Dependency Injection

managedcode/dotnet-skills

Guidance for configuring dependency injection in .NET MAUI apps — service registration in MauiProgram.cs, lifetime selection (Singleton / Transient / Scoped), constructor injection, Shell navigation auto-resolution, platform-specific registrations, and testability patterns. USE FOR: "dependency injection", "DI setup", "AddSingleton", "AddTransient", "AddScoped", "service registration", "constructor injection", "IServiceProvider", "MauiProgram DI", "register services", "BindingContext injection". DO NOT USE FOR: data binding (use maui-data-binding), Shell route configuration (use maui-shell-navigation), unit-test mocking frameworks (use standard xUnit and NSubstitute patterns).
3 views 527 repository stars 0 commentsUpdated Nov 27, 2026
Overview

Guidance for configuring dependency injection in .NET MAUI apps — service registration in MauiProgram.cs, lifetime selection (Singleton / Transient / Scoped), constructor injection, Shell navigation auto-resolution, platform-specific registrations, and testability patterns. USE FOR: "dependency injection", "DI setup", "AddSingleton", "AddTransient", "AddScoped", "service registration", "constructor injection", "IServiceProvider", "MauiProgram DI", "register services", "BindingContext injection". DO NOT USE FOR: data binding (use maui-data-binding), Shell route configuration (use maui-shell-navigation), unit-test mocking frameworks (use standard xUnit and NSubstitute patterns).

Installation & variants

Download the repository, including the skill’s supporting files.

git clone -- 'https://github.com/managedcode/dotnet-skills' skill-source

Use the complete skill-source/catalog/Frameworks/Official-DotNet-MAUI/skills/maui-dependency-injection directory with your client’s skill installer.

  • catalog/Frameworks/Official-DotNet-MAUI/skills/maui-dependency-injection

    main · SKILL.md

    Open installation source

    Source directory recorded from the imported repository path

Source directory catalog/Frameworks/Official-DotNet-MAUI/skills/maui-dependency-injection

Source instructions
Read source instructions

Open to load source instructions

Original SKILL.md

Open to load the original file

Source & validation
Source status
Awaiting source check
Format validation
Format valid
Checked at
Pending source check
Content SHA-256
445608d3402ace275e7d6ea69c57cb7cd1aa0eb8387cd7293a3bbbaf90fa505c
Discussion
Comments Be the First to Comment

Please log in to comment

    No comments yet

Related skills