# Hosting.Avaloniaui **Repository Path**: shooterf/Hosting.Avaloniaui ## Basic Information - **Project Name**: Hosting.Avaloniaui - **Description**: No description available - **Primary Language**: C# - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-11-04 - **Last Updated**: 2025-11-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 🚀 Hosting.AvaloniauiDesktop

NuGet Package Version AOT Supported Linux Supported macOS Supported Windows Supported

# Introduction .NET Generic Host support for Avaloniaui desktop app. Support native aot! - Examples: ```C# internal sealed class Program { [STAThread] public static void Main(string[] args) { var hostBuilder = Host.CreateApplicationBuilder(); // config IConfiguration hostBuilder.Configuration .AddCommandLine(args) .AddEnvironmentVariables() .AddInMemoryCollection(); // config ILogger hostBuilder.Services.AddLogging(builder => builder.AddConsole()); // add some services hostBuilder.Services.AddSingleton(); RunApp(hostBuilder); } private static void RunApp(HostApplicationBuilder hostBuilder) { hostBuilder.Services.AddAppBuilder(BuildAvaloniaApp); var appHost = hostBuilder.Build(); appHost.RunAvaloniaAppAsync(); } public static AppBuilder BuildAvaloniaApp() { return AppBuilder.Configure() .UsePlatformDetect() .WithInterFont() .LogToTrace() .UseReactiveUI(); } } ``` References: [Nito.Host.Wpf](https://github.com/StephenCleary/Hosting)