Project setup
This guide explains how to run a minimal Asv.Avalonia application. After setup, you can explore the Test Drive section to learn how to customize application's pages.
This guide assumes that you are already familiar with the basics of Avalonia UI.
Prerequisites
This project depends on Avalonia UI, so please review the Avalonia requirements.
The current version of Asv.Avalonia targets .NET 10.0. The framework is cross-platform, so it supports Windows, macOS, Linux, and mobile (Android/iOS).
Choosing an Editor
We recommend using JetBrains Rider with the AvaloniaRider plugin. Read more in the Avalonia Editor Setup guide.
Creating a project
First, create a project for the application and add Avalonia to it. There are two ways to do this:
Use an Avalonia template (recommended and described below) by following this guide (steps 1 and 2).
Manual Setup: create an empty project and add Avalonia manually.
For this guide, we will use the "Avalonia .NET App" template. First, install the templates:
Then, create a new project:
This creates an AsvAvaloniaTest project using the Desktop-only Avalonia template (avalonia.app).
Adding Asv.Avalonia to the project
To install the Asv.Avalonia library, run the following command in your project directory:
Now we must modify our template to run the Asv.Avalonia shell.
1. Clean up the Template
Since Asv.Avalonia handles the main window logic for us, we do not need the default window files. So we can delete MainWindow.axaml and MainWindow.axaml.cs.
2. Configure Program.cs
We need to set up the application host. Change your Program class to this:
The Main method builds and starts the Avalonia application. After the window closes, it gracefully stops and disposes the AppHost. If anything goes wrong, HandleApplicationCrash logs the error.
In BuildAvaloniaApp, we configure Avalonia and initialize the framework via .UseAsv(...). This call sets up the application host and internally integrates the R3 reactive framework. Inside the builder callback you can customize the application: enable or disable features like the Log Viewer or single-instance mode, and set up the desktop shell.
3. Configure App.axaml.cs
Now, let's edit the App.axaml.cs code-behind file. Our App class should inherit from AsvApplication:
AsvApplication handles dependency injection setup, view locator registration, shell initialization, and platform detection — so your App class only needs to load the XAML.
4. Configure Styles
Finally, include the Asv.Avalonia styles in your App.axaml file:
Running the app
You can now try running the application. You should see a shell with standard pages, such as Settings and the Log Viewer — these are located in the tools section of the shell. Below that is the items section, which currently contains the Device Browser.

If you want to customize the application (e.g., add new pages or commands), follow the Test Drive guide.