This template creates a solution with all needed projects for an Avalonia UI project.
Create a new app in your current directory by running.
> dotnet new keboo.avalonia
| 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
This template uses a global.json file to specify the required .NET SDK version. To update the .NET SDK version:
- Update the
global.jsonfile in the solution root - Update the
<TargetFrameworks>in thecsprojfiles.
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.