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.Install the Extension
Download and install the Avalonia for Visual Studio extension from the Visual Studio Marketplace.Alternatively, install from within Visual Studio:
- Go to Extensions > Manage Extensions
- Search for “Avalonia”
- Click Download and restart Visual Studio
JetBrains Rider
Rider has built-in support for Avalonia with excellent XAML tooling.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.
Visual Studio Code
VS Code works with Avalonia through the .NET CLI and extensions.Install C# Extension
Install the C# Dev Kit extension for .NET support.
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.| Template | Short Name | Description |
|---|---|---|
| Avalonia App | avalonia.app | Full desktop application |
| Avalonia MVVM App | avalonia.mvvm | App with MVVM architecture |
| Avalonia Cross-Platform App | avalonia.xplat | Multi-platform app (Desktop, Mobile, Browser) |
| Avalonia Window | avalonia.window | Window component |
| Avalonia UserControl | avalonia.usercontrol | Reusable user control |
| Avalonia Resource Dictionary | avalonia.resource | Resource dictionary |
Creating a New Project
Adding to Existing Projects
Add Avalonia to an existing .NET project via NuGet.Platform-Specific Setup
Linux
On Linux, you may need additional dependencies:iOS Development
For iOS development, you’ll need:- macOS with Xcode 13 or later
- .NET for iOS workload
Android Development
For Android development:WebAssembly
For browser-based applications:Verifying Installation
Create and run a test project to verify everything is working:Development Tools
Avalonia DevTools
Enable developer tools in your application for runtime debugging:Program.cs
Hot Reload
Avalonia supports .NET Hot Reload for rapid development:Nightly Builds
To use the latest features, you can configure the nightly build feed:NuGet.config