Categories
.NET MAUI Extensions Templates Visual Studio Xamarin

.NET MAUI – Templates for Visual Studio 2022

.NET MAUI Project and Item templates for Visual Studio 2022 with a VS extension package.

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.

Visual Studio Manage Extensions Dialog
Visual Studio – Manage Extensions (.NET MAUI in focus)

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)
.NET MAUI project templates in Visual Studio 2022
Visual Studio – Create Project – .NET MAUI templates

And for Item templates, ContentPage (both XAML and C#) and has been named as:

  • Content Page (.NET MAUI)
  • Content Page (C#) (.NET MAUI)
Visual Studio – Add New Item – Content Page template

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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s