Microsoft.Windows.CppWinRT 2.0.190529.9

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.190529.9                
NuGet\Install-Package Microsoft.Windows.CppWinRT -Version 2.0.190529.9                
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.190529.9" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Microsoft.Windows.CppWinRT --version 2.0.190529.9                
#r "nuget: Microsoft.Windows.CppWinRT, 2.0.190529.9"                
#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.
// Install Microsoft.Windows.CppWinRT as a Cake Addin
#addin nuget:?package=Microsoft.Windows.CppWinRT&version=2.0.190529.9

// Install Microsoft.Windows.CppWinRT as a Cake Tool
#tool nuget:?package=Microsoft.Windows.CppWinRT&version=2.0.190529.9                

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 | *true | false | 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 | | CppWinRTParameters | "" | Custom cppwinrt.exe command-line parameters (be sure to append to existing) | | CppWinRTFastAbi | true | *false | Enables Fast ABI feature for both consuming and producing projections | | CppWinRTProjectLanguage | C++/CX | *C++/WinRT | Selects the C++ dialect for the project. C++/WinRT provides full projection support, C++/CX permits consuming projection headers. | | CppWinRTOptimized | true | *false | Enables component projection optimization features (e.g., unified construction) | *Default value

To customize common C++/WinRT project properties:

  • right-click the project node
  • expand the Common Properties item
  • select the C++/WinRT property page

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 5 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
microsoft/devhome
The new Dev Home experience for Windows!
Version Downloads Last updated
2.0.240405.15 67,576 4/5/2024
2.0.240111.5 68,362 1/12/2024
2.0.230706.1 237,693 7/6/2023
2.0.230524.4 10,544 5/25/2023
2.0.230524.3 2,333 5/24/2023
2.0.230225.1 121,169 2/25/2023
2.0.230207.1 202,891 2/7/2023
2.0.221121.5 170,285 11/21/2022
2.0.221117.1 13,063 11/17/2022
2.0.221104.6 119,815 11/4/2022
2.0.221101.3 3,098 11/1/2022
2.0.220929.3 48,624 9/29/2022
2.0.220912.1 27,118 9/12/2022
2.0.220909.4 2,267 9/12/2022
2.0.220608.4 89,046 6/8/2022
2.0.220607.4 4,571 6/8/2022
2.0.220531.1 101,331 6/1/2022
2.0.220418.1 219,976 4/18/2022
2.0.220331.4 38,984 3/31/2022
2.0.220325.3 174,090 3/25/2022
2.0.220315.1 3,198 3/15/2022
2.0.220224.4 10,070 2/25/2022
2.0.220131.2 158,222 1/31/2022
2.0.220110.5 75,789 1/10/2022
2.0.220110.4 2,299 1/10/2022
2.0.220110.3 2,263 1/10/2022
2.0.211028.7 521,847 10/29/2021
2.0.210930.14 25,364 10/1/2021
2.0.210930.8 1,897 9/30/2021
2.0.210922.5 36,465 9/22/2021
2.0.210913.7 22,717 9/13/2021
2.0.210825.3 6,533 8/25/2021
2.0.210806.1 305,233 8/6/2021
2.0.210722.2 22,093 7/22/2021
2.0.210714.1 9,420 7/14/2021
2.0.210709.3 3,908 7/9/2021
2.0.210708.4 4,468 7/8/2021
2.0.210707.1 2,331 7/7/2021
2.0.210629.4 4,641 6/30/2021
2.0.210629.2 2,163 6/29/2021
2.0.210624.2 3,112 6/24/2021
2.0.210621.3 19,837 6/21/2021
2.0.210621.2 2,066 6/21/2021
2.0.210505.3 49,010 5/6/2021
2.0.210504.3 32,195 5/4/2021
2.0.210503.1 11,070 5/3/2021
2.0.210427.2 5,222 4/27/2021
2.0.210403.2 17,307 4/4/2021
2.0.210329.4 3,814 3/29/2021
2.0.210326.8 2,159 3/26/2021
2.0.210326.4 2,022 3/26/2021
2.0.210312.4 418,816 3/12/2021
2.0.210312.3 1,982 3/12/2021
2.0.210309.3 34,796 3/10/2021
2.0.210304.5 2,466 3/4/2021
2.0.210304.4 2,031 3/4/2021
2.0.210301.1 5,339 3/1/2021
2.0.210225.3 2,977 2/26/2021
2.0.210211.2 17,186 2/12/2021
2.0.210122.3 9,564 1/23/2021
2.0.201217.4 52,229 12/17/2020
2.0.201215.2 1,889 12/15/2020
2.0.201201.7 389,056 12/9/2020
2.0.201113.7 168,940 11/13/2020
2.0.201102.2 60,321 11/2/2020
2.0.201026.4 2,338 10/26/2020
2.0.201017.1 38,536 10/18/2020
2.0.201008.2 4,592 10/8/2020
2.0.201006.7 2,343 10/7/2020
2.0.200921.6 85,959 9/21/2020
2.0.200917.4 3,895 9/18/2020
2.0.200729.8 152,448 7/29/2020
2.0.200728.4 2,420 7/29/2020
2.0.200703.9 158,032 7/4/2020
2.0.200630.5 10,619 6/30/2020
2.0.200630.4 2,200 6/30/2020
2.0.200615.7 235,635 6/16/2020
2.0.200609.3 4,583 6/9/2020
2.0.200602.3 8,604 6/2/2020
2.0.200602.2 2,064 6/2/2020
2.0.200601.2 2,036 6/1/2020
2.0.200531.2 2,189 6/1/2020
2.0.200514.2 14,804 5/14/2020
2.0.200512.4 2,554 5/12/2020
2.0.200511.2 2,650 5/11/2020
2.0.200508.4 2,357 5/8/2020
2.0.200316.3 263,372 3/16/2020
2.0.200303.2 3,328 3/5/2020
2.0.200302.1 35,235 3/2/2020
2.0.200224.2 3,452 2/24/2020
2.0.200213.5 1,860 3/5/2020
2.0.200203.5 19,709 2/3/2020
2.0.200203.3 2,006 2/3/2020
2.0.200117.5 54,430 1/17/2020
2.0.200116.6 2,995 1/16/2020
2.0.200115.8 2,568 1/15/2020
2.0.200107.1 2,949 1/7/2020
2.0.191217.1 8,491 12/18/2019
2.0.191202.6 62,243 12/2/2019
2.0.191202.4 2,257 12/2/2019
2.0.191202.2 2,017 12/2/2019
2.0.191111.2 19,738 11/11/2019
2.0.191029.4 3,654 11/7/2019
2.0.191023.3 2,094 11/7/2019
2.0.191018.6 4,713 10/18/2019
2.0.190730.2 144,473 7/30/2019
2.0.190729.1 2,266 7/29/2019
2.0.190722.3 6,127 7/22/2019
2.0.190712.2 2,500 7/12/2019
2.0.190710.3 8,188 7/12/2019
2.0.190620.2 23,747 6/21/2019
2.0.190605.7 25,010 6/6/2019
2.0.190603.8 4,674 6/3/2019
2.0.190603.6 2,414 6/3/2019
2.0.190603.5 2,212 6/3/2019
2.0.190603.4 2,593 6/3/2019
2.0.190530.8 7,447 5/31/2019
2.0.190529.9 39,740 5/29/2019
2.0.190506.1 28,983 5/6/2019
2.0.190425.5 8,739 4/25/2019
2.0.190417.3 63,340 4/17/2019
2.0.190408.1 12,273 4/8/2019
2.0.190405.3 2,483 4/5/2019
2.0.190404.8 4,792 4/5/2019
2.0.190402.6 3,055 4/3/2019
2.0.190401.2 2,593 4/2/2019
2.0.190329.3 2,665 4/2/2019
1.0.190211.5 13,541 2/11/2019
1.0.190205.2 12,058 2/10/2019
1.0.190128.4 2,767 2/10/2019
1.0.190111.3 3,333 4/6/2019
1.0.190109.2 15,325 1/9/2019
1.0.181129.3 9,490 11/29/2018
1.0.181115.3 3,046 11/15/2018
1.0.181108.4 2,940 11/9/2018
1.0.181002.2 4,921 10/3/2018
1.0.180914.4 3,059 9/14/2018
1.0.180913.3 3,583 9/13/2018