Skip to content

Latest commit

 

History

History
62 lines (43 loc) · 2.22 KB

File metadata and controls

62 lines (43 loc) · 2.22 KB

Avalonia solution template

This template creates a solution with all needed projects for an Avalonia UI project.

Template

Create a new app in your current directory by running.

> dotnet new keboo.avalonia

Parameters

Default template options

Parameter Description Default
--sln Use legacy .sln format instead of .slnx format false
--tests Testing framework to use. Options: xunit, mstest, tunit, none xunit

Example with legacy .sln format:

> dotnet new keboo.avalonia --sln true

Example with MSTest:

> dotnet new keboo.avalonia --tests mstest

Example with no tests:

> dotnet new keboo.avalonia --tests none

Updating .NET Version

This template uses a global.json file to specify the required .NET SDK version. To update the .NET SDK version:

  1. Update the global.json file in the solution root
  2. Update the <TargetFrameworks> in the csproj files.

Key Features

Build Customization

Docs

Centralized Package Management

Docs

CommunityToolkit MVVM

Docs

NuGet package source mapping

Docs

Solution File Format (slnx)

By default, this template uses the new .slnx (XML-based solution) format introduced in .NET 9. This modern format is more maintainable and easier to version control compared to the legacy .sln format.

Blog: Introducing slnx support in the dotnet CLI
Docs: dotnet sln command

If you need to use the legacy .sln format, use the --sln true parameter when creating the template.