.NET MAUI Project and Object Templates - Visual Studio Marketplace (2023)

.NET MAUI project, item templates and code snippets for Visual Studio 2022

Recognized as one ofBest Free Extensions for Visual Studio 2022vonVisual Studio-Magazin, a recognized technology site.

stay connected with medeveloper thoughtsBlog to learn more about .NET MAUI and Blazor.

This VS Extension is loaded with projects, item templates and code snippets for working with .NET MAUI in Visual Studio 2022.

This has project templates for:
  • .NET MAUI App - an all-in-one app project template - check this out for more detailsArticle
  • .NET MAUI Application (C#)
  • .NET MAUI class library
  • Shared Class Library (Xamarin.Forms and .NET MAUI)
And article templates for:

ContentPage and ContentView as well as XAML and C#.

Shell Page for defining the app's visual hierarchy and Resource Dictionary for managing resources, both in XAML.

  • Content Page (.NET MAUI)
  • Content Page (C#) (.NET MAUI)
  • Content page with ViewModel (.NET MAUI)
  • Content Page (C#) with ViewModel (.NET MAUI)
  • Content View (.NET MAUI)
  • Content View (C#) (.NET MAUI)
  • Resource Dictionary (.NET MAUI)
  • Resource dictionary (XAML only) (.NET MAUI)
  • Shell Page (.NET MAUI)
  • Custom view and controller (normal) (.NET MAUI)
    • Controller definitions generated in the Platforms folder
  • Custom view and controller (cond.) (.NET MAUI)
    • Controller definitions are generated in the same folder in a conditional build format
  • Custom view and (normal) renderer (.NET MAUI)
    • Generated renderer definitions in the Platforms folder.
  • Custom Renderer and View (Continued) (.NET MAUI)
    • Renderer definitions generated in the same folder in a conditional build format
  • Subclass (C#)
    • Available in the section titledCode
  • For cond. write the template to make it work properly. Make sure conditional compilation is enabled as mentioned in detailHere
C# and XAML code snippets

Note: Currently the project templates are intended for .NET MAUI 6/7 GA and its service releases, .NET 8 Previews (VS2022 17.3.0 or higher) and to support other changes in newer .NET versions. MAUI, an update for this VS extension will be available accordingly.

Version history (latest above):

  • The .NET MAUI workload is now a prerequisite for installing this extension (until now it has been tested on VS2022 17.3.0 or higher).

3.0.0.0:

  • Updated templates to support .NET 8 Preview 1.

2.4.0.0:

  • CommunityToolkit.Maui.MarkupUpdated NuGet package for v3.0.0 supporting TypedBindings
  • An ItemTemplate for the (partial) C# class has been introduced.Available in the section titledCode

2.3.1.0:

2.3.0.0:

  • Ability to add a referenceCommunityToolkit.Maui.MediaElementNuGet and configure it in the launch pipeline to play audio/video in a .NET MAUI app
  • Dependent packages have been updated to point to the latest stable release
    • CommunityToolkit.Maui - v4.0.0
    • CommunityToolkit.Mvvm - v8.1.0

2.2.0.0:

  • Updated template pack to support .NET 7 SR1 (v7.0.52).
  • The base framework is also included as a target (net6.0/net7.0) for the .NET MAUI application project template if thetarget platformis set toat.

2.1.3.0:

  • The target platform parameter is now updated as a multiple choice value. It can be chosen according to need.
  • And little cleaning to improve the reliability of the models.

2.1.1.1:

  • Updated template pack to support newly released .NET 7 NuGet dependencies

  • For application projects targeting .NET 7, option to add and configureMaui understandableNuGet-Packages (Dual-Screen-compatible Apps)

    • Note: If the project targets .NET 6, selecting the Collapsible/Maps option has NO effect.

2.1.0.0:

  • The templates have been updated to support .NET MAUI on .NET 7 GA (a version of STS).

2.0.3.0:

  • Templates have been updated to support .NET MAUI in .NET 7 RC2 (preview).

  • A parameter named--target-plataforma|-tpintroduced, which takes one of the following values ​​(withatis the default).

    • All: Developed for all possible .NET MAUI compatible platforms.
    • Android - Targets the Android platform.
    • iOS: Developed for the iOS platform.
    • macOS: Targeted for the macOS platform via Mac Catalyst.
    • Windows: Designed for the Windows platform.
    • Tizen - Developed for the Tizen platform.
    • Mobile: Developed for Android and iOS platforms.
    • Desktop - Designed for Windows and macOS platforms.
    • Apple: Developed for iOS and macOS platforms.

2.0.0.0:

  • Templates have been updated to support .NET MAUI in .NET 7 (RC1 - Preview) (--Structure/-FParameter).
  • Maps can be accepted as they are now defined as another project creation option (--include-maps/-in meParameter)

1.7.6.3:

  • CommunityToolkit.MvvmThe NuGet package is out of preview and is now stable so the package version (8.0.0) has been updated.

1.7.6.1:

  • Added the following new element templates for creating a content page using the ViewModel.

    • Content page with ViewModel (.NET MAUI)
    • Content Page (C#) with ViewModel (.NET MAUI)
    • so much for himPage with ViewModelFor templates, ensure that only the actual name of the page is provided as input, e.gIdeaswhilebook pagemisee modelis added as a suffixsettings pagemiCustomizationsViewModel.
    • The page is generated inviewpointsfolder and the ViewModel is generated in itSee modelsPasta.
    • ViewModels are generated using the base class titledBaseViewModel(Implementation left to the user).
    • It is recommended to addCommunityToolkit.Mvvm, an officially supported NuGet package (currently in preview) to make working with the MVVM design pattern easier.
    • This MVVM - RelievedPart 1miPart 2The articles can help you get started with this new NuGet package.

1.7.5.0:

  • The following new element templates have been added to create a custom display definition available in the MAUI section of the Add New Element dialog.

    • Custom view and controller (normal) (.NET MAUI)
    • Custom view and controller (cond.) (.NET MAUI)
    • Custom view and (normal) renderer (.NET MAUI)
    • Custom Renderer and View (Continued) (.NET MAUI)
    1. The normal type template generates the driver/threader source files in the platform folder, while Cond. Type template contains them in a single folder.
    2. For conditional type formatting, ensure that conditional compilation is configured in the project file for compilation to succeed. An additional option is provided during project creation in VS IDE and CLI (or manually afterwards).
  • Added the option to configure conditional compilation, so platform source files can be defined anywhere in the project as long as they follow a naming convention as mentioned below. This allows you to keep the associated source files in the same place, especially the MAUI drivers.

    • *.Standard.cs: Files intended for the BCL
    • *.Android.cs - Android specific files
    • *.iOS.cs - File sharing with iOS and MacCatalyst
    • *.MacCatalyst.cs - MacCatalyst specific files
    • *.Tizen.cs - Tizen specific files
    • *.Windows.cs: Windows specific files
  • Parametername:-cc|--conditional-compile

1.7.1.0:

  • Introduced a new parameter to include all supported packages in the shared class library template, adding a reference to the 6 supported NuGet packages.
    • Parametername:- aspid|--all supported packages
  • IncludingIsExternalInitType definition to allow C# records at compile time for Xamarin.Forms
  • CommunityToolkit.MvvmUpdated version of the NuGet package to support the latest preview release

1.7.0.0:

  • The models have been updated to the stable release version of .NET MAUI GA
  • .NET MAUI workload is now a prerequisite for installing this extension
  • Also check out the newly included project template to create oneshared class librarywhich produces assemblies targeting Xamarin.Forms and .NET MAUI
  • With the C# markup, globalusings, and compiler directives, bothXamarin.Formsmi.NET FIXEDcan be run from a single project

1.6.0.0:

  • Includes a project template for creating ashared class librarywhich produces assemblies targeting Xamarin.Forms and .NET MAUI
  • With the C# markup, globalusings, and compiler directives, bothXamarin.Formsmi.NET FIXEDcan be run from a single project

1.5.0.0:

  • Updated project templates to support .NET MAUI RC3 with VS2022 Preview 17.3.0 Preview 1.0 or higher
  • .NET MAUI workload is now a prerequisite for installing this extension

1.4.1.0:

  • Service-Release in v1.4.0.0
  • The CommunityToolkit.Maui and CommunityToolkit.Maui.Markup NuGet package versions have been updated to v1.0.0-rc2

1.4.0.0:

  • Updated project templates to support .NET MAUI RC2 with VS2022 Preview 17.2.0 Preview 5.0 or higher
  • .NET MAUI Workload (Preview) is now a prerequisite for installing this extension
  • The VS Code Workspace file included in the project is hidden when working in Visual Studio
  • Updated project templates to include Tizen platform artifacts
  • Added an option to reference the CommunityToolkit.Mvvm (aka Microsoft MVVM Toolkit) NuGet package during project creation.
    • More details about this exciting MVVM toolkit can be found hereArticle

1.3.1.0:

  • Service-Release in v1.3.0.0
  • Added theme support for the .NET MAUI Blazor Hybrid App project
  • The BlazorWebView developer tools have been conditionally enabled to create a pixel-perfect UI
  • Added a VS Code workspace file to the project to make it work perfectly in the IDE

1.3.0.0:

  • Updated project templates to support .NET MAUI RC1 with VS2022 Preview 17.2.0 Preview 3.0 or higher
  • .NET MAUI Workload (Preview) is now a prerequisite for installing this extension
  • Added support for app themes to the MAUI Blazor .NET hybrid app project
  • The style definition has been restructured for better scalingFuente,font size,Luz, miDarkSet topic-specific properties
    • See the Styles.xaml file in the Resources folder for more details.

1.2.0.0:

  • Updated project templates to support .NET MAUI Preview 14 with VS2022 Preview 17.2.0 or later
  • .NET MAUI Workload (Preview) is now a prerequisite for installing this extension

1.1.1.0:

  • To effectively support theBlazorWebViewNameCode snippet, including the .NET MAUI Blazor namespace itself as a code snippet with a titled shortcutMegabyte(means Maui Blazor)
  • It also includes the WPF Blazor namespace as a snippet (because it's all XAML) with a link to the titlewb

1.1.0.0:

  • Introducing an All-in-One .NET MAUI Application Project Template - Click here for more detailsArticle
  • Added xaml snippet forBlazorWebViewNametitled with an abbreviationbwvcomxmlnsprefix likeB, type in one of the xaml filesbwvand press Tab to paste the snippet. Refer toOut ofGuide to a detailed list and its links
    • add to The xml namespace (xmlns) does not yet implicitly support Xaml fragments, so it is a manual action
  • .NET MAUI Workload (Preview) (VS2022 17.2 Preview 1.0 or later) is now a prerequisite for installing this extension release

1.0.0.10:

  • Updated project templates to support .NET MAUI Preview 12 with VS2022 Preview
  • .NET MAUI Workload (Preview) is now a prerequisite for installing this extension
  • Added a XAML-only resource dictionary element template because its code-behind is rarely used (a maintenance overhead).

1.0.0.9:

  • Updated project templates to support .NET MAUI Preview 10 with VS2022 Preview
  • .NET MAUI Workload (Preview) is now a prerequisite for installing this extension

1.0.0.8:

  • Updated project templates for .NET MAUI Preview 8 with a single project for all supported platforms
  • .NET MAUI workload is now a prerequisite for installing this extension

1.0.0.7:

  • Project Template for .NET MAUI App (C#)
  • Usability improvements in C# and XAML snippets

1.0.0.6:

  • C# and XAML code snippets (seeOut ofGuide for a detailed list and its links)

1.0.0.5

  • .NET MAUI class library design template
  • Shell element template and resource dictionary, both in XAML

1.0.0.4

  • Small correction in the BlazorApp template

1.0.0.3

  • Updated templates for .NET 6 Preview 7
  • Support for VS2022 Preview 3.0
  • Removed use of Ipage and IView interfaces from ContentPage and ContentView templates, respectively

1.0.0.2

  • ContentView element templates in XAML and C#

1.0.0.1

  • Article templates are categorized in a separate folder titledMAUIfor quick access

1.0.0.0

  • First release of models.

Videos

1. Start Your New .NET MAUI App with These Amazing Templates!
(Gerald Versluis)
2. WebView in .Net MAUI App using Visual Studio 2022
(Hacked)
3. Setting up a .NET MAUI Project with DevExpress controls
(DevExpress)
4. Learn .NET MAUI - Full Course for Beginners | Build cross-platform apps in C#
(James Montemagno)
5. Visual Studio Live! - Native Cross-Platform Mobile & Desktop Apps with .NET MAUI
(Microsoft Developer)
6. Setup Your .NET MAUI Dev Environment - .NET Maui Crash Course #1
(Gerald Versluis)
Top Articles
Latest Posts
Article information

Author: Jerrold Considine

Last Updated: 02/05/2023

Views: 6545

Rating: 4.8 / 5 (58 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Jerrold Considine

Birthday: 1993-11-03

Address: Suite 447 3463 Marybelle Circles, New Marlin, AL 20765

Phone: +5816749283868

Job: Sales Executive

Hobby: Air sports, Sand art, Electronics, LARPing, Baseball, Book restoration, Puzzles

Introduction: My name is Jerrold Considine, I am a combative, cheerful, encouraging, happy, enthusiastic, funny, kind person who loves writing and wants to share my knowledge and understanding with you.