bymanagedcode· 121 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).
$npx -y skills add managedcode/dotnet-skills --skill maui-dependency-injectionInstalls into the current project.
Run `npx skills use "https://github.com/managedcode/dotnet-skills" --skill "managedcode/dotnet-skills/maui-dependency-injection"` and follow the generated skill instructions now. Read its complete output, redirecting it to a temporary file first if necessary. Resolve relative paths from the supporting-files directory it provides.
Use the skills in "https://github.com/managedcode/dotnet-skills" that are relevant to the current task. Run `npx skills add "https://github.com/managedcode/dotnet-skills"` and select the relevant skills, then follow their instructions.