Skip to main content

Create your first project

Create and run your first Avalonia application using the MVVM template in your preferred IDE or from the command line.


This guide walks you through creating a new Avalonia app from a template and running it. By the end, you will have a working Avalonia window on screen.

Create the project

For your first project, use the Model-View-ViewModel (MVVM) template. This template sets up a project with the MVVM pattern, which is the recommended way to structure Avalonia applications.

  1. In Visual Studio, click File → New → Project/Solution.
  2. In the search box, input "Avalonia".
  3. Select Avalonia .NET MVVM App from the search results. If Visual Studio offers multiple options, select the one for C#. Then, click Next.
  4. Name your project "GetStartedApp".
  5. Change the target directory if desired. Then, click Next.
  6. Select your preferred version of .NET as the framework.
  7. If given the option to choose target platforms, select Desktop.
  8. Click Create.

Run the project

In the top toolbar, select "GetStartedApp" next to the Run button. Then, click Run.

The solution builds and runs your app in a new window. By default, this displays the string, "Welcome to Avalonia!"

A screenshot of the default Avalonia app running in a window.

What's in the project?

The MVVM template creates a project with the following structure:

File/FolderPurpose
App.axamlApplication-level resources and styles. The .axaml extension is short for Avalonia XAML.
ViewModels/Contains MainWindowViewModel, which holds data and logic for the main window.
Views/MainWindow.axamlThe XAML markup that defines the main window's appearance.
Views/MainWindow.axaml.csThe code-behind file for the main window.
Program.csThe application entry point that configures and launches Avalonia.

Next steps

You have a working Avalonia app. Continue with the starter tutorial to build a temperature converter and learn core Avalonia concepts: