With .NET 6 Preview 6 released last week, .NET MAUI progressed a lot with Workloads, Gestures, Clipping, Alerts, and mainly support for VS2022 (with Preview 2.0) but, there is a catch in here. NO templates for VS2022 for now :-(.
We have to still rely on the .NET CLI templates for working with VS2022, and switching between CLI and VS IDE is always a pain.
Thankfully, VS extensions will always be there as a rescue in this sort of situation, and this time too. Have published an extension to the VS marketplace, exclusive for VS2022 users, that hosts the MAUI templates.
This can be downloaded from the Visual Studio Marketplace and then installed with VSIX installer or an easy way, install directly from within Visual Studio IDE itself (Extensions -> Manage Extensions or Alt+X+M shortcut). To find this template, search with the maui keyword. Refer to the below screenshot.
This has a project template for both MAUI and MAUI Blazor and it has been named as:
- .NET MAUI App (Preview)
- .NET MAUI Blazor App (Preview)
And for Item templates, ContentPage (both XAML and C#) and has been named as:
- Content Page (.NET MAUI)
- Content Page (C#) (.NET MAUI)
Note: Currently, the project templates target .NET 6 Preview 6, and to support further changes in future .NET 6 releases, an update to this VS extension will be made available accordingly. ContentPage will work with future versions as well, as not much change is expected over there.
Update: Users on VS2019 don’t need to feel left out in this, I got you covered with another extension that hosts the Item templates for ContentPage, in both XAML and C#, find it in the VS Marketplace – .NET MAUI Item Templates.
For cross-platform users, a CLI-based .NET MAUI Item Template is available to install from a NuGet package. And then can be invoked with dotnet new command. For more details, check out the GitHub repository.
Happy coding. Stay connected as we continue to learn and share the experiences from this exciting journey of being a software developer.