Creating first .Net MAUI project

Viewed 5600

I tried to create Maui project in windows using visual studio developer command prompt using
Command :
dotnet new maui

But Its not creating Maui project,Getting Error message No templates found matching : maui
I installed the .Net 5 and visual studio 2019 in my machine.

5 Answers

There is a known issue, please install the template manually:

dotnet new -i Microsoft.Maui.Templates

It's now recommended to create .NET Maui apps with Visual Studio according to their current documentation.

Older suggestion:

I'd recommend using the check tool provided. This will install the templates for you and make sure everything else is present to develop using Maui.

Install: dotnet tool install -g redth.net.maui.check

Run: maui-check --dev

This will check for:

OpenJdk / AndroidSDK
.NET 6 Preview SDK
.NET MAUI / iOS / Android workloads and packs
.NET MAUI Templates
Workload Resolver .sentinel files for dotnet and Visual Studio Windows/Mac
Currently does not install workloads required for WinUI3

This should help you out:

https://github.com/dotnet/maui

https://github.com/dotnet/net6-mobile-samples

Take a look at the section "Using IDEs":

Using IDEs

IDE integration into Visual Studio, Visual Studio for Mac, and Visual Studio Code are a work in progress.

Visual Studio

Currently, you can use Visual Studio 2019 16.9 on Windows (with the Xamarin workload) with a few manual steps to run iOS & Android apps built on .NET 6.

For Visual Studio integration you need at least 16.11 preview 1. Use the maui-check tool to install/upgrade the prerequisites on your system. The tool is constantly updated to ensure that the latest MAUI capabilities are installed. Every time a new preview comes out (approximately monthly), rerun maui-check.

Related