Skip to content

MAUI Hosting

Recommended for most apps

.NET MAUI is the recommended hosting model for Shiny. A single line of code wires up all platform lifecycle hooks, dependency injection, and background services — so you can focus on registering your Shiny modules.

  1. Install the NuGet package

    NuGet package Shiny.Hosting.Maui
  2. Add UseShiny() to your MauiProgram.cs

    using Shiny;
    namespace ShinyApp;
    public static class MauiProgram
    {
    public static MauiApp CreateMauiApp()
    {
    var builder = MauiApp
    .CreateBuilder()
    .UseMauiApp<App>()
    .UseShiny() // <-- this wires all Shiny lifecycle through MAUI
    .ConfigureFonts(fonts =>
    {
    fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
    fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
    });
    // Register your Shiny services here
    // builder.Services.AddGps<MyGpsDelegate>();
    // builder.Services.AddJob(typeof(MyJob));
    return builder.Build();
    }
    }
  3. Register Shiny services

    Use builder.Services to register any Shiny modules you need — GPS, Bluetooth, Jobs, Notifications, etc. See each module’s Getting Started page for specifics.

ScenarioHosting Model
Standard .NET MAUI appMAUI (this page)
.NET native without MAUI (iOS/Android)Native
Existing app with complex platform setupManual