Microsoft.Windows.CppWinRT 2.0.190405.3

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.

Requires NuGet 2.5 or higher.

dotnet add package Microsoft.Windows.CppWinRT --version 2.0.190405.3
                    
NuGet\Install-Package Microsoft.Windows.CppWinRT -Version 2.0.190405.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.Windows.CppWinRT" Version="2.0.190405.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.Windows.CppWinRT" Version="2.0.190405.3" />
                    
Directory.Packages.props
<PackageReference Include="Microsoft.Windows.CppWinRT" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Microsoft.Windows.CppWinRT --version 2.0.190405.3
                    
#r "nuget: Microsoft.Windows.CppWinRT, 2.0.190405.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Microsoft.Windows.CppWinRT&version=2.0.190405.3
                    
Install Microsoft.Windows.CppWinRT as a Cake Addin
#tool nuget:?package=Microsoft.Windows.CppWinRT&version=2.0.190405.3
                    
Install Microsoft.Windows.CppWinRT as a Cake Tool

Microsoft.Windows.CppWinRT NuGet Package

Overview

Please visit Microsoft.Windows.CppWinRT for official Microsoft-signed builds of the NuGet package. See also the C++/WinRT VSIX, which provides C++/WinRT project templates and debug visualization.

To add build support for C++/WinRT vcxproj projects, add a reference to the Microsoft.Windows.CppWinRT NuGet package. This customizes your project's build rules to automatically generate C++/WinRT projection headers, enabling you to both consume and produce Windows Runtime classes.

C++/WinRT detects Windows metadata referenced by the project, from:

  • Platform winmd files in the SDK (both MSI and NuGet)
  • NuGet packages containing winmd files
  • Other projects producing winmd files
  • Raw winmd files
  • Interface definition language (IDL) files in the project

For any winmd file referenced by the project, C++/WinRT creates reference (consuming) projection headers. Client code can simply #include these headers, which are created in the generated files directory (see below).

For any IDL file contained in the project, C++/WinRT creates component (producing) projection headers. In addition, C++/WinRT generates templates and skeleton implementations for each runtime class, under the generated files directory.

Details

C++/WinRT configures build rules for the following tools:

  • C++ compiler
  • C++/WinRT compiler
  • MdMerge utility
  • Midlrt utility
  • Xaml compiler

It sets the following project properties and item metadata:

| Property | Value | Description | |-|-|-| | PreferredToolArchitecture | x64 | Enables the compiler to use more memory | | CanReferenceWinRT | true | Enables native project references (e.g., to WinMD files) | | GeneratedFilesDir | *$(IntDir)Generated Files\ | Sets the folder for C++/WinRT generated source files | | XamlLanguage | CppWinRT | Directs the Xaml compiler to generate C++/WinRT code | | ClCompile.CompileAsWinRT | *false | Enables ISO C++ compilation (disables C++/CX) | | ClCompile.LanguageStandard | *stdcpp17 | Enables C++17 language features | | ClCompile.AdditionalOptions | /bigobj /await | Enables support for large object files and coroutines | | ClCompile.AdditionalIncludeDirectories | GeneratedFilesDir | Adds $(GeneratedFilesDir) to the C++ include dirs | | Link.AdditionalDependencies | WindowsApp.lib | Umbrella library for Windows Runtime imports | | Midl.AdditionalOptions | /reference ... | Enables faster compilation with winmd references (versus idl imports) | | Midl.EnableWindowsRuntime | true | Enables Windows Runtime semantics | | Midl.MetadataFileName | Unmerged%(Filename).winmd | Generates unmerged metadata in a tempoary location | | Midl.GenerateClientFiles, GenerateServerFiles, GenerateStublessProxies, GenerateTypeLibrary, HeaderFileName, DllDataFileName, InterfaceIdentifierFileName, ProxyFileName, TypeLibraryName | *nul, *None, *false | Disable unnecessary output | *If not already set

Generated Files

The generated files directory created by C++/WinRT contains two subfolders:

  • sources: runtime class skeleton implementations
  • winrt: reference projection headers

Customizing

C++/WinRT behavior can be customized with these project properties:

| Property | Value | Description | |-|-|-| | CppWinRTLibs | *true | false | Enables the Link item metadata settings above | | CppWinRTModernIDL | *true | false | Enables the Midl item metadata settings above | | CppWinRTVerbosity | low | *normal | high | Sets the importance of C++/WinRT build messages (see below) | | CppWinRTNamespaceMergeDepth | *1 | Sets the depth of namespace merging (Xaml apps require 1) | | CppWinRTUsePrefixes | *false | true | Uses a dotted prefix namespace convention (versus a nested folder convention) | | CppWinRTPath | ...\cppwinrt.exe | NuGet package-relative path to cppwinrt.exe, for custom build rule invocation | *Default value

Troubleshooting

The msbuild verbosity level maps to msbuild message importance as follows:

| Verbosity | Importance | |-|-| | q[uiet] | n/a | | m[inimal] | high | | n[ormal] | normal+ | | d[etailed], diag[nostic] | low+ | For example, if the verbosity is set to minimal, then only messages with high importance are generated. However, if the verbosity is set to diagnostic, then all messages are generated.

The default importance of C++/WinRT build messages is 'normal', but this can be overridden with the CppWinRTVerbosity property to enable throttling of C++/WinRT messages independent of the overall verbosity level.

Example:

msbuild project.vcxproj /vebosity:minimal /property:CppWinRTVerbosity=high ...

For more complex analysis of build errors, the MSBuild Binary and Structured Log Viewer is highly recommended.

Product Compatible and additional computed target framework versions.
native native is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Microsoft.Windows.CppWinRT:

Package Downloads
Unpackaged

Helpers for unpackaged and XAML Islands apps

WinUIEssential.WinUI3

Essential helpers for developing WinUI(UWP)

GitHub repositories (21)

Showing the top 20 popular GitHub repositories that depend on Microsoft.Windows.CppWinRT:

Repository Stars
microsoft/PowerToys
Windows system utilities to maximize productivity
files-community/Files
A modern file manager that helps users organize their files and folders.
mono/SkiaSharp
SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
UnigramDev/Unigram
Telegram for Windows
dotnet/sdk
Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
ikas-mc/ContextMenuForWindows11
Add Custom Context Menu For Windows11
microsoft/AdaptiveCards
A new way for developers to exchange card content in a common and consistent way.
BedrockLauncher/BedrockLauncher
MCMrARM/mc-w10-version-launcher
Windows 10 Multi-Version launcher.
zhuxb711/RX-Explorer
一款优雅的UWP文件管理器 | An elegant UWP Explorer
dotnet/dotnet
Home of .NET's Virtual Monolithic Repository which includes all the code needed to build the .NET SDK.
microsoft/MixedRealityCompanionKit
This is a MixedRealityToolkit style repository for code bits and components that may not run directly on Microsoft HoloLens or immersive headsets but instead pair with them to build experiences.
microsoft/CsWinRT
C# language projection for the Windows Runtime
microsoft/psi
Platform for Situated Intelligence
microsoft/react-native-windows-samples
A repository showcasing React Native samples and templates for Windows, macOS, and Surface Duo.
CommunityToolkit/Microsoft.Toolkit.Win32
ARCHIVE - This repository contained XAML Islands wrapper controls and tooling for XAML Islands with WinUI 2, see readme for more info about XAML Islands with WinUI 3 and the WindowsAppSDK.
WindowsAppCommunity/Quarrel
Quarrel is a Discord client for Windows and Xbox that aims to bring voice chat to Xbox and improved support for varying screen sizes on devices running windows.
microsoft/Win2D-Samples
Sample code showing how to use Win2D
microsoft/Windows-Camera
Tools and samples for camera related APIs on Windows
ad2017gd/RainbowTaskbar
Powerful, customizable Windows 10/11 taskbar effects.
Version Downloads Last updated
2.0.250303.1 3 5/29/2025
2.0.240405.15 251,261 4/5/2024
2.0.240111.5 93,838 1/12/2024
2.0.230706.1 354,050 7/6/2023
2.0.230524.4 12,453 5/25/2023
2.0.230524.3 2,520 5/24/2023
2.0.230225.1 136,343 2/25/2023
2.0.230207.1 283,497 2/7/2023
2.0.221121.5 212,732 11/21/2022
2.0.221117.1 14,956 11/17/2022
2.0.221104.6 120,523 11/4/2022
2.0.221101.3 3,137 11/1/2022
2.0.220929.3 53,145 9/29/2022
2.0.220912.1 27,776 9/12/2022
2.0.220909.4 2,309 9/12/2022
2.0.220608.4 107,031 6/8/2022
2.0.220607.4 4,617 6/8/2022
2.0.220531.1 132,440 6/1/2022
2.0.220418.1 264,996 4/18/2022
2.0.220331.4 39,315 3/31/2022
2.0.220325.3 214,139 3/25/2022
2.0.220315.1 3,288 3/15/2022
2.0.220224.4 10,415 2/25/2022
2.0.220131.2 162,004 1/31/2022
2.0.220110.5 131,590 1/10/2022
2.0.220110.4 2,348 1/10/2022
2.0.220110.3 2,317 1/10/2022
2.0.211028.7 605,177 10/29/2021
2.0.210930.14 28,832 10/1/2021
2.0.210930.8 1,943 9/30/2021
2.0.210922.5 36,717 9/22/2021
2.0.210913.7 22,889 9/13/2021
2.0.210825.3 6,653 8/25/2021
2.0.210806.1 393,707 8/6/2021
2.0.210722.2 22,257 7/22/2021
2.0.210714.1 9,482 7/14/2021
2.0.210709.3 3,956 7/9/2021
2.0.210708.4 4,531 7/8/2021
2.0.210707.1 2,382 7/7/2021
2.0.210629.4 4,736 6/30/2021
2.0.210629.2 2,209 6/29/2021
2.0.210624.2 3,312 6/24/2021
2.0.210621.3 20,270 6/21/2021
2.0.210621.2 2,115 6/21/2021
2.0.210505.3 49,406 5/6/2021
2.0.210504.3 32,270 5/4/2021
2.0.210503.1 16,263 5/3/2021
2.0.210427.2 5,421 4/27/2021
2.0.210403.2 18,056 4/4/2021
2.0.210329.4 3,929 3/29/2021
2.0.210326.8 2,213 3/26/2021
2.0.210326.4 2,076 3/26/2021
2.0.210312.4 494,443 3/12/2021
2.0.210312.3 2,055 3/12/2021
2.0.210309.3 36,234 3/10/2021
2.0.210304.5 2,523 3/4/2021
2.0.210304.4 2,086 3/4/2021
2.0.210301.1 6,476 3/1/2021
2.0.210225.3 3,054 2/26/2021
2.0.210211.2 17,396 2/12/2021
2.0.210122.3 9,739 1/23/2021
2.0.201217.4 52,900 12/17/2020
2.0.201215.2 1,948 12/15/2020
2.0.201201.7 468,856 12/9/2020
2.0.201113.7 191,198 11/13/2020
2.0.201102.2 62,194 11/2/2020
2.0.201026.4 2,403 10/26/2020
2.0.201017.1 38,701 10/18/2020
2.0.201008.2 4,731 10/8/2020
2.0.201006.7 2,408 10/7/2020
2.0.200921.6 86,221 9/21/2020
2.0.200917.4 4,031 9/18/2020
2.0.200729.8 153,274 7/29/2020
2.0.200728.4 2,476 7/29/2020
2.0.200703.9 167,805 7/4/2020
2.0.200630.5 10,698 6/30/2020
2.0.200630.4 2,256 6/30/2020
2.0.200615.7 310,937 6/16/2020
2.0.200609.3 4,723 6/9/2020
2.0.200602.3 8,800 6/2/2020
2.0.200602.2 2,125 6/2/2020
2.0.200601.2 2,097 6/1/2020
2.0.200531.2 2,253 6/1/2020
2.0.200514.2 14,914 5/14/2020
2.0.200512.4 2,613 5/12/2020
2.0.200511.2 2,843 5/11/2020
2.0.200508.4 2,435 5/8/2020
2.0.200316.3 342,189 3/16/2020
2.0.200303.2 3,393 3/5/2020
2.0.200302.1 35,308 3/2/2020
2.0.200224.2 3,512 2/24/2020
2.0.200213.5 1,937 3/5/2020
2.0.200203.5 20,177 2/3/2020
2.0.200203.3 2,084 2/3/2020
2.0.200117.5 54,596 1/17/2020
2.0.200116.6 3,054 1/16/2020
2.0.200115.8 2,626 1/15/2020
2.0.200107.1 3,014 1/7/2020
2.0.191217.1 8,568 12/18/2019
2.0.191202.6 62,336 12/2/2019
2.0.191202.4 2,314 12/2/2019
2.0.191202.2 2,074 12/2/2019
2.0.191111.2 23,517 11/11/2019
2.0.191029.4 3,715 11/7/2019
2.0.191023.3 2,154 11/7/2019
2.0.191018.6 4,802 10/18/2019
2.0.190730.2 145,792 7/30/2019
2.0.190729.1 2,326 7/29/2019
2.0.190722.3 6,197 7/22/2019
2.0.190712.2 2,574 7/12/2019
2.0.190710.3 8,249 7/12/2019
2.0.190620.2 24,037 6/21/2019
2.0.190605.7 25,101 6/6/2019
2.0.190603.8 4,732 6/3/2019
2.0.190603.6 2,470 6/3/2019
2.0.190603.5 2,271 6/3/2019
2.0.190603.4 2,653 6/3/2019
2.0.190530.8 7,507 5/31/2019
2.0.190529.9 39,807 5/29/2019
2.0.190506.1 29,757 5/6/2019
2.0.190425.5 8,831 4/25/2019
2.0.190417.3 63,483 4/17/2019
2.0.190408.1 12,476 4/8/2019
2.0.190405.3 2,547 4/5/2019
2.0.190404.8 4,941 4/5/2019
2.0.190402.6 3,116 4/3/2019
2.0.190401.2 2,660 4/2/2019
2.0.190329.3 2,755 4/2/2019
1.0.190211.5 13,689 2/11/2019
1.0.190205.2 12,293 2/10/2019
1.0.190128.4 2,844 2/10/2019
1.0.190111.3 3,406 4/6/2019
1.0.190109.2 15,679 1/9/2019
1.0.181129.3 9,625 11/29/2018
1.0.181115.3 3,122 11/15/2018
1.0.181108.4 3,015 11/9/2018
1.0.181002.2 5,024 10/3/2018
1.0.180914.4 3,141 9/14/2018
1.0.180913.3 3,729 9/13/2018