How To Use Templates In Visual Studio
This browser is no longer supported.
Upgrade to Microsoft Edge to have advantage of the latest features, security updates, and technical support.
Visual Studio projection and detail templates for Windows apps
Visual Studio 2019 (and subsequently) provides many project and particular templates that aid y'all build apps for Windows 11 and Windows 10 devices by using C# or C++. This topic describes the templates and helps you cull ane for your scenario.
- Project templates include project files, code files, and other assets that are configured to build an app or a component that can be loaded and used by an app.
- Detail templates are projection files that contain unremarkably used lawmaking and XAML that tin can exist added to a projection to reduce development time. For example, you can use an item template to add a new window, page, or control to your app.
For more information nearly installing and configuring Visual Studio to go access to these templates, see Install tools for the Windows App SDK.
WinUI templates
The Windows UI Library (WinUI) is the modern native user interface (UI) platform for Windows apps across desktop (.NET and native Win32) and UWP app platforms. WinUI 3 is the latest major version of WinUI, and it transforms WinUI into a total UX framework for desktop Windows apps.
WinUI iii is available equally part of the Windows App SDK. Information technology includes a VSIX packet for Visual Studio 2019 (and after) that provides projection and item templates that help yous get started edifice apps with a WinUI-based interface.
For more information most the available WinUI project and item templates, see WinUI 3 templates in Visual Studio.
UWP templates
Visual Studio provides a variety of project templates for building UWP apps with C# or C++. To use these project templates, you must include the Universal Windows Platform development workload when you install Visual Studio. For the C++ project templates, you must likewise include the C++ (v142) Universal Windows Platforms tools optional component for the Universal Windows Platform development workload.
Project templates for C# and UWP
To access the UWP C# project templates when you create a new projection in Visual Studio, filter the language to C#, the platform to Windows, and the project type to UWP.
You lot can use these project templates to create C# UWP apps.
| Template | Description |
|---|---|
| Blank App (Universal Windows) | Creates a UWP app. The generated projection includes a basic page that derives from the Windows.UI.Xaml.Controls.Folio class that you can employ to start building your UI. |
| Unit of measurement Examination App (Universal Windows) | Creates a unit test project in C# for a UWP app. For more information, see Unit exam C# code. |
You can utilize these project templates to build pieces of a C# UWP app.
| Template | Description |
|---|---|
| Class Library (Universal Windows) | Creates a managed class library (DLL) in C# that can exist used by other UWP apps written in managed code. |
| Windows Runtime Component (Universal Windows) | Creates a Windows Runtime component in C# that can be consumed by any UWP app, regardless of the programming linguistic communication in which the app is written. |
| Optional Code Package (Universal Windows) | Creates an optional package with executable C# code that can be loaded past an app. For more data, see Optional packages with executable lawmaking. |
Project templates for C++ and UWP
There are two different technologies you tin can use to build C++ UWP apps:
- The recommended engineering science is C++/WinRT. This is a C++ language project that is implemented entirely in header files, and designed to provide you with outset-class access to the mod WinRT API.
- Alternatively, y'all can employ the older C++/CX ready of extensions. C++/CX is even so supported, merely we recommend that yous use C++/WinRT instead.
To access the UWP C++ project templates when you create a new project in Visual Studio, filter the language to C++, the platform to Windows, and the project type to UWP.
Note
By default, the Universal Windows Platform development workload in Visual Studio just provides access to the C++/CX project templates. To access the C++/WinRT project templates, you must install the C++/WinRT VSIX bundle.
You lot tin use these projection templates to create C++ UWP apps.
| Template | Description |
|---|---|
| Blank App (C++/WinRT) | Creates a C++/WinRT UWP app with a XAML user interface. The generated projection includes a basic page that derives from the Windows.UI.Xaml.Controls.Folio grade that yous can use to beginning building your UI. |
| Core App (C++/WinRT) | Creates a C++/WinRT UWP app that uses CoreApplication to integrate with a diverseness of UI frameworks instead of a XAML user interface. For a walkthrough that demonstrates how to apply this project template to create a simple game that uses DirectX, meet Create a simple UWP game with DirectX. |
| Bare App (Universal Windows - C++/CX) | Creates a C++/WinRT UWP app with a XAML user interface. The generated project includes a basic folio that derives from the Windows.UI.Xaml.Controls.Page class in the WinUI library that you lot can utilize to start building your UI. |
| DirectX 11 and XAML App (Universal Windows - C++/CX) | Creates a UWP app that uses DirectX 11 and a SwapChainPanel so yous can use XAML UI controls. For more information, come across DirectX game project templates. |
| DirectX 11 App (Universal Windows - C++/CX) | Creates a UWP app that uses DirectX 11. For more data, see DirectX game project templates. |
| DirectX 12 App (Universal Windows - C++/CX) | Creates a UWP app that uses DirectX 12. For more than information, see DirectX game project templates. |
| Unit Test App (Universal Windows - C++/CX) | Creates a unit exam project in C++/CX for a UWP app. For more information, run across How to test a C++ UWP DLL. |
You can use these project templates to build pieces of a C++ UWP app.
| Template | Description |
|---|---|
| Windows Runtime Component (C++/WinRT) | Creates a Windows Runtime component in C++/WinRT that can exist consumed past any UWP app, regardless of the programming linguistic communication in which the app is written. |
| Windows Runtime Component (Universal Windows) | Creates a Windows Runtime component in C++/CX that tin can be consumed past any UWP app, regardless of the programming language in which the app is written. |
| DLL (Universal Windows) | A projection for creating a dynamic-link library (DLL) in C++/CX that can be used in a UWP app. For more than information, see DLLs (C++/CX). |
| Static Library (Universal Windows) | A projection for creating a static library (LIB) in C++/CX that can exist used in a UWP app. For more information, see Static libraries (C++/CX). |
C++ desktop (Win32) templates
Visual Studio provides a variety of projection templates for building desktop Windows apps with native C++ and direct access to the Win32 API. To use these project templates, you must include the Desktop development with C++ workload when you install Visual Studio. This workload includes projection templates for building desktop apps, console apps, and libraries.
The recommended engineering science is C++/WinRT. This is a C++ language projection that is implemented entirely in header files, and designed to provide y'all with first-course access to the modernistic WinRT API.
Project templates for C++ desktop apps
To admission the C++ projection templates for classic desktop apps when you create a new projection in Visual Studio, filter the language to C++, the platform to Windows, and the projection blazon to Desktop.
| Template | Description |
|---|---|
| Windows Desktop Application (C++/WinRT) | Creates a C++/WinRT client application for Windows desktop. For more information, come across Windows Desktop Application (C++/WinRT). This project template requires the C++/WinRT VSIX. |
| Windows Desktop Application | Creates a classic Windows desktop app with C++. For more information, see Walkthrough: Create a traditional Windows Desktop awarding. |
| Windows Desktop Magician | Provides a stride-by-step sorcerer you can use to create i of the following types of projects: a archetype Windows desktop app, a panel app, a dynamic-link library (DLL), or a static library. For more information, encounter Windows Desktop Wizard and Walkthrough: Create a traditional Windows Desktop awarding. |
| Windows Awarding Packaging Project | Creates a project that yous can employ to build a desktop app into an MSIX package. This provides a modern deployment experience, the power to integrate with Windows features via package extensions, and much more. For more information, see Windows Application Packaging Project. |
Project templates for C++ panel apps
To access the C++ project templates for console apps, filter the language to C++, the platform to Windows, and the project type to Console.
| Template | Description |
|---|---|
| Windows Panel Application (C++/WinRT) | Creates a C++/WinRT console app without a user interface. For more data, see C++/WinRT quick-starting time. This projection template requires the C++/WinRT VSIX. |
| Console App | Creates a console app without a user interface. For more than information, see Walkthrough: Creating a Standard C++ Program. |
| Empty Projection | An empty project for creating an application, library, or DLL. Y'all must add any code or resources required. |
Projection templates for C++ libraries
To access the C++ project templates for libraries, filter the language to C++, the platform to Windows, and the projection blazon to Library.
| Template | Clarification |
|---|---|
| Dynamic-Link Library (DLL) | A projection for creating a dynamic-link library (DLL). For more information, run across Walkthrough: Creating and using a dynamic link library. |
| Static Library | A projection for creating a static library (LIB). For more than information, see Walkthrough: Create and use a static library. |
Item templates for C++ desktop apps
The C++ project templates for include many particular templates that you tin can use to perform tasks similar calculation new files and resources to your project. For a comprehensive list, see Using Visual C++ Add New Item Templates.
.NET templates
Visual Studio provides a diversity of project templates for edifice desktop Windows apps that use .NET and C#. To utilise these project templates, you must include the .NET desktop development workload when you install Visual Studio.
To admission the .Internet C# project templates when you create a new project in Visual Studio, filter the language to C#, the platform to Windows, and the project type to Desktop.
You can use these project templates to create apps using C# and .NET.
| Template | Description |
|---|---|
| WPF Application | Creates a WPF app that targets .NET five or .NET Cadre iii.1. For a walkthrough of this project template, see Create a WPF application. |
| WPF App (.NET Framework) | Creates a WPF app that targets the .Net Framework. For a walkthrough of this project template, see Tutorial: Create your first WPF awarding. |
| Windows Forms App | Creates a Windows Forms app that targets .NET five or .NET Core 3.one. |
| Windows Forms App (.NET Framework) | Creates a Windows Forms app that targets the .NET Framework. For a walkthrough of this project template, run into Create a Windows Forms app in Visual Studio with C#. |
| Windows Application Packaging Project | Creates a project that yous can apply to build a WPF or Windows Forms app into an MSIX package. This provides a modern deployment experience, the ability to integrate with Windows features via packet extensions, and much more. For more information, run across Windows Awarding Packaging Projection. |
Feedback
Submit and view feedback for
How To Use Templates In Visual Studio,
Source: https://docs.microsoft.com/en-us/windows/apps/desktop/visual-studio-templates
Posted by: erwinwhold1959.blogspot.com

0 Response to "How To Use Templates In Visual Studio"
Post a Comment