Skip to content
Shiny.NET
Shiny MAUI Shell v7 - App Links, App Shortcuts, & Navigation Interception!Shortcut me to it

MAUI Hosting

MAUI apps often end up with a massive MauiProgram.cs where every plugin, service, and lifecycle hook is crammed together. Shiny MAUI Hosting lets you break that apart into modular IMauiModule classes — each responsible for its own service registration and post-build initialization. It also provides a static ShinyHost.Services accessor, an IAppSupport service for orientation/culture/time-zone change detection and device info, and an IAppStore service for cross-platform store version lookups and deep links.

GitHub GitHub stars for shinyorg/extensions
Downloads NuGet downloads for Shiny.Extensions.MauiHosting
Frameworks
.NET MAUI
  • Modular IMauiModule interface — combines service registration and post-build initialization in one class
  • Static ShinyHost.Services for accessing the service provider from anywhere
  • IAppSupport — device info, orientation control, and live change notifications for orientation, culture, and time zone
  • IAppStore — cross-platform store version lookups, deep links, and review-page launches for the Apple App Store, Mac App Store, Google Play, Microsoft Store, and Linux Flatpak/Snap
  • Desktop backends from dotnet/maui-labs — macOS AppKit (net10.0-macos) and Linux GTK4 (via Shiny.Extensions.MauiHosting.Linux)
  • Opt-in registration: each capability ships as its own extension method (AddAppSupport, AddAppStore) so apps only pay for what they use
  1. Install the NuGet package:

    Terminal window
    dotnet add package Shiny.Extensions.MauiHosting
  2. Create a module for each concern:

    using Shiny;
    public class MyModule : IMauiModule
    {
    public void Add(MauiAppBuilder builder)
    {
    builder.Services.AddSingleton<IMyService, MyService>();
    }
    public void Use(IPlatformApplication app)
    {
    // Post-build initialization (do NOT block here)
    }
    }
  3. Wire everything up in MauiProgram.cs:

    using Shiny;
    var builder = MauiApp.CreateBuilder();
    builder
    .UseMauiApp<App>()
    .AddInfrastructureModules(new MyModule()) // your IMauiModule list
    .AddAppSupport() // IAppSupport
    .AddAppStore(opts => // IAppStore (omit if not needed)
    {
    opts.AppleAppId = "1234567890";
    opts.WindowsProductId = "9NBLGGH4NNS1";
    });
    return builder.Build();

Each module implements IMauiModule with two methods:

  • Add(MauiAppBuilder builder) — register services, configure the builder. This runs before the app is built.
  • Use(IPlatformApplication app) — post-build initialization. The service provider is available via ShinyHost.Services. Do NOT block here — this runs on the main thread during app startup.
public class AnalyticsModule : IMauiModule
{
public void Add(MauiAppBuilder builder)
{
builder.Services.AddSingleton<IAnalytics, AppCenterAnalytics>();
}
public void Use(IPlatformApplication app)
{
var analytics = ShinyHost.Services.GetRequiredService<IAnalytics>();
analytics.TrackEvent("AppStarted");
}
}

After the app is built and initialized, ShinyHost.Services provides access to the service provider from anywhere:

// Resolve a service from anywhere in your app
var service = ShinyHost.Services.GetRequiredService<IMyService>();

IAppSupport provides device info, browser/map helpers, programmatic orientation control, and live change notifications for orientation, culture, and time zone. See App Support for the full member list and platform notes.

IAppStore looks up the latest published version from the relevant platform store and deep-links into the store or review page. See App Store for configuration options and per-platform behavior.

.NET MAUI ships no first-party macOS (AppKit) or Linux head. Both come from dotnet/maui-labs, and this library supports them — macOS from the net10.0-macos asset of the main package, Linux from the companion Shiny.Extensions.MauiHosting.Linux package. See Desktop Backends.

claude plugin marketplace add shinyorg/skills
claude plugin install shiny@shiny

One plugin installs all 36 Shiny skills. Your agent loads only the skill relevant to what you're building, so there's no cost to having them all available.

copilot plugin marketplace add https://github.com/shinyorg/skills
copilot plugin install shiny@shiny

One plugin installs all 36 Shiny skills. Your agent loads only the skill relevant to what you're building, so there's no cost to having them all available.

View shiny-maui-hosting Skill