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.
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.
Install the NuGet package
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(); }}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.
| Scenario | Hosting Model |
|---|---|
| Standard .NET MAUI app | MAUI (this page) |
| .NET native without MAUI (iOS/Android) | Native |
| Existing app with complex platform setup | Manual |