Microsoft.Windows.CppWinRT 2.0.190405.3

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. 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.
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.
// Install Microsoft.Windows.CppWinRT as a Cake Addin
#addin nuget:?package=Microsoft.Windows.CppWinRT&version=2.0.190405.3

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

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 5 popular GitHub repositories that depend on Microsoft.Windows.CppWinRT:

Repository Stars
microsoft/PowerToys
Windows system utilities to maximize productivity
files-community/Files
Building the best file manager for Windows
UnigramDev/Unigram
Telegram for Windows
microsoft/devhome
The new Dev Home experience for Windows!
dotnet/sdk
Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
Version Downloads Last updated
2.0.240111.5 13,074 1/12/2024
2.0.230706.1 99,721 7/6/2023
2.0.230524.4 8,425 5/25/2023
2.0.230524.3 1,955 5/24/2023
2.0.230225.1 89,269 2/25/2023
2.0.230207.1 131,982 2/7/2023
2.0.221121.5 112,809 11/21/2022
2.0.221117.1 9,998 11/17/2022
2.0.221104.6 99,127 11/4/2022
2.0.221101.3 2,851 11/1/2022
2.0.220929.3 39,819 9/29/2022
2.0.220912.1 22,273 9/12/2022
2.0.220909.4 1,926 9/12/2022
2.0.220608.4 63,413 6/8/2022
2.0.220607.4 4,299 6/8/2022
2.0.220531.1 67,075 6/1/2022
2.0.220418.1 163,843 4/18/2022
2.0.220331.4 32,295 3/31/2022
2.0.220325.3 127,175 3/25/2022
2.0.220315.1 2,918 3/15/2022
2.0.220224.4 9,366 2/25/2022
2.0.220131.2 115,267 1/31/2022
2.0.220110.5 38,747 1/10/2022
2.0.220110.4 2,043 1/10/2022
2.0.220110.3 1,975 1/10/2022
2.0.211028.7 458,676 10/29/2021
2.0.210930.14 19,774 10/1/2021
2.0.210930.8 1,665 9/30/2021
2.0.210922.5 30,931 9/22/2021
2.0.210913.7 22,315 9/13/2021
2.0.210825.3 6,132 8/25/2021
2.0.210806.1 215,557 8/6/2021
2.0.210722.2 21,765 7/22/2021
2.0.210714.1 9,143 7/14/2021
2.0.210709.3 3,657 7/9/2021
2.0.210708.4 4,268 7/8/2021
2.0.210707.1 2,039 7/7/2021
2.0.210629.4 4,251 6/30/2021
2.0.210629.2 1,937 6/29/2021
2.0.210624.2 2,534 6/24/2021
2.0.210621.3 18,717 6/21/2021
2.0.210621.2 1,781 6/21/2021
2.0.210505.3 45,584 5/6/2021
2.0.210504.3 25,841 5/4/2021
2.0.210503.1 7,959 5/3/2021
2.0.210427.2 4,709 4/27/2021
2.0.210403.2 16,259 4/4/2021
2.0.210329.4 3,454 3/29/2021
2.0.210326.8 1,974 3/26/2021
2.0.210326.4 1,796 3/26/2021
2.0.210312.4 391,590 3/12/2021
2.0.210312.3 1,695 3/12/2021
2.0.210309.3 31,731 3/10/2021
2.0.210304.5 2,255 3/4/2021
2.0.210304.4 1,822 3/4/2021
2.0.210301.1 4,173 3/1/2021
2.0.210225.3 2,784 2/26/2021
2.0.210211.2 16,700 2/12/2021
2.0.210122.3 9,097 1/23/2021
2.0.201217.4 50,852 12/17/2020
2.0.201215.2 1,607 12/15/2020
2.0.201201.7 273,330 12/9/2020
2.0.201113.7 132,308 11/13/2020
2.0.201102.2 45,738 11/2/2020
2.0.201026.4 2,233 10/26/2020
2.0.201017.1 38,094 10/18/2020
2.0.201008.2 4,225 10/8/2020
2.0.201006.7 2,129 10/7/2020
2.0.200921.6 72,865 9/21/2020
2.0.200917.4 3,470 9/18/2020
2.0.200729.8 144,351 7/29/2020
2.0.200728.4 2,202 7/29/2020
2.0.200703.9 137,675 7/4/2020
2.0.200630.5 10,321 6/30/2020
2.0.200630.4 1,935 6/30/2020
2.0.200615.7 211,170 6/16/2020
2.0.200609.3 4,191 6/9/2020
2.0.200602.3 8,249 6/2/2020
2.0.200602.2 1,879 6/2/2020
2.0.200601.2 1,842 6/1/2020
2.0.200531.2 1,939 6/1/2020
2.0.200514.2 14,482 5/14/2020
2.0.200512.4 2,394 5/12/2020
2.0.200511.2 2,407 5/11/2020
2.0.200508.4 2,080 5/8/2020
2.0.200316.3 233,992 3/16/2020
2.0.200303.2 3,164 3/5/2020
2.0.200302.1 35,048 3/2/2020
2.0.200224.2 3,334 2/24/2020
2.0.200213.5 1,718 3/5/2020
2.0.200203.5 18,642 2/3/2020
2.0.200203.3 1,759 2/3/2020
2.0.200117.5 44,697 1/17/2020
2.0.200116.6 2,754 1/16/2020
2.0.200115.8 2,380 1/15/2020
2.0.200107.1 2,726 1/7/2020
2.0.191217.1 8,280 12/18/2019
2.0.191202.6 52,585 12/2/2019
2.0.191202.4 2,005 12/2/2019
2.0.191202.2 1,796 12/2/2019
2.0.191111.2 16,087 11/11/2019
2.0.191029.4 3,432 11/7/2019
2.0.191023.3 1,839 11/7/2019
2.0.191018.6 4,436 10/18/2019
2.0.190730.2 143,012 7/30/2019
2.0.190729.1 2,066 7/29/2019
2.0.190722.3 5,848 7/22/2019
2.0.190712.2 2,282 7/12/2019
2.0.190710.3 8,004 7/12/2019
2.0.190620.2 23,082 6/21/2019
2.0.190605.7 24,626 6/6/2019
2.0.190603.8 4,438 6/3/2019
2.0.190603.6 2,148 6/3/2019
2.0.190603.5 1,976 6/3/2019
2.0.190603.4 2,280 6/3/2019
2.0.190530.8 7,243 5/31/2019
2.0.190529.9 39,540 5/29/2019
2.0.190506.1 27,534 5/6/2019
2.0.190425.5 8,490 4/25/2019
2.0.190417.3 62,960 4/17/2019
2.0.190408.1 11,806 4/8/2019
2.0.190405.3 2,284 4/5/2019
2.0.190404.8 4,326 4/5/2019
2.0.190402.6 2,749 4/3/2019
2.0.190401.2 2,339 4/2/2019
2.0.190329.3 2,320 4/2/2019
1.0.190211.5 13,224 2/11/2019
1.0.190205.2 11,556 2/10/2019
1.0.190128.4 2,526 2/10/2019
1.0.190111.3 3,117 4/6/2019
1.0.190109.2 14,929 1/9/2019
1.0.181129.3 9,115 11/29/2018
1.0.181115.3 2,739 11/15/2018
1.0.181108.4 2,666 11/9/2018
1.0.181002.2 4,661 10/3/2018
1.0.180914.4 2,823 9/14/2018
1.0.180913.3 3,098 9/13/2018