Skip to main content
Get started with Avalonia UI by installing the necessary tools and packages for your development environment.

Prerequisites

Before installing Avalonia, ensure you have:
  • .NET SDK 6.0 or later - Download from Microsoft
  • An IDE - Visual Studio 2022, JetBrains Rider, or Visual Studio Code
  • Optional: Platform-specific SDKs for mobile development (Xcode for iOS, Android SDK)
Avalonia UI requires .NET 6.0 or later for the latest features and best performance.

IDE Setup

Visual Studio 2022

The official Avalonia Visual Studio Extension provides templates and designer support.
1

Install the Extension

Download and install the Avalonia for Visual Studio extension from the Visual Studio Marketplace.Alternatively, install from within Visual Studio:
  1. Go to Extensions > Manage Extensions
  2. Search for “Avalonia”
  3. Click Download and restart Visual Studio
2

Verify Installation

After restarting Visual Studio, verify the extension is installed:
  1. Go to File > New > Project
  2. Search for “Avalonia”
  3. You should see Avalonia project templates

JetBrains Rider

Rider has built-in support for Avalonia with excellent XAML tooling.
1

Enable Avalonia Support

Avalonia support is included in Rider 2020.3 and later. Simply open or create an Avalonia project and Rider will provide IntelliSense, code completion, and refactoring support.
2

Install XAML Previewer (Optional)

For XAML preview support, install the AvaloniaRider plugin:
  1. Go to File > Settings > Plugins
  2. Click Manage Plugin Repositories
  3. Add: https://plugins.jetbrains.com/plugins/dev/14839
  4. Search for and install AvaloniaRider

Visual Studio Code

VS Code works with Avalonia through the .NET CLI and extensions.
1

Install C# Extension

Install the C# Dev Kit extension for .NET support.
2

Install Avalonia Extension

Install the Avalonia for VSCode extension for XAML support and templates.

Installing Avalonia Packages

Using .NET CLI Templates

The fastest way to start is with the official Avalonia templates.
dotnet new install Avalonia.Templates
Available templates:
TemplateShort NameDescription
Avalonia Appavalonia.appFull desktop application
Avalonia MVVM Appavalonia.mvvmApp with MVVM architecture
Avalonia Cross-Platform Appavalonia.xplatMulti-platform app (Desktop, Mobile, Browser)
Avalonia Windowavalonia.windowWindow component
Avalonia UserControlavalonia.usercontrolReusable user control
Avalonia Resource Dictionaryavalonia.resourceResource dictionary

Creating a New Project

dotnet new avalonia.mvvm -o MyAvaloniaApp
cd MyAvaloniaApp
dotnet run

Adding to Existing Projects

Add Avalonia to an existing .NET project via NuGet.
# Core Avalonia package
dotnet add package Avalonia

# Desktop support
dotnet add package Avalonia.Desktop

# Diagnostics and dev tools
dotnet add package Avalonia.Diagnostics

# Themes
dotnet add package Avalonia.Themes.Fluent
Make sure to use consistent versions across all Avalonia packages to avoid compatibility issues.

Platform-Specific Setup

Linux

On Linux, you may need additional dependencies:
sudo apt-get install libx11-dev libice-dev libsm-dev libfontconfig1-dev

iOS Development

For iOS development, you’ll need:
  • macOS with Xcode 13 or later
  • .NET for iOS workload
dotnet workload install ios

Android Development

For Android development:
dotnet workload install android

WebAssembly

For browser-based applications:
dotnet workload install wasm-tools

Verifying Installation

Create and run a test project to verify everything is working:
1

Create Test Project

dotnet new avalonia.mvvm -o AvaloniaTest
cd AvaloniaTest
2

Build the Project

dotnet build
You should see a successful build with no errors.
3

Run the Application

dotnet run
A window should appear with the default Avalonia application.

Development Tools

Avalonia DevTools

Enable developer tools in your application for runtime debugging:
Program.cs
public static AppBuilder BuildAvaloniaApp()
    => AppBuilder.Configure<App>()
        .UsePlatformDetect()
        .UseSkia()
        .WithInterFont()
        .LogToTrace()
        .WithDeveloperTools();  // Add this line
Press F12 while running to open DevTools.

Hot Reload

Avalonia supports .NET Hot Reload for rapid development:
dotnet watch run
Changes to your code will be applied without restarting the app.

Nightly Builds

To use the latest features, you can configure the nightly build feed:
NuGet.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="AvaloniaUI Nightly" value="https://nuget-feed-all.avaloniaui.net/v3/index.json" />
  </packageSources>
</configuration>
Nightly builds may contain unstable features. Use them for testing new features, not for production applications.

Next Steps

Now that you have Avalonia installed, continue to the Quick Start guide to build your first application.

Build docs developers (and LLMs) love