Microsoft.Windows.CppWinRT 2.0.190530.8

C++/WinRT is a standard C++ language projection for the Windows Runtime implemented solely in header files. It allows you to both author and consume Windows Runtime APIs using any standards-compliant C++ compiler. C++/WinRT is designed to provide C++ developers with first-class access to the modern Windows API.

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

Requires NuGet 2.5 or higher.

Install-Package Microsoft.Windows.CppWinRT -Version 2.0.190530.8
dotnet add package Microsoft.Windows.CppWinRT --version 2.0.190530.8
<PackageReference Include="Microsoft.Windows.CppWinRT" Version="2.0.190530.8" />
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.190530.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Microsoft.Windows.CppWinRT, 2.0.190530.8"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. 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.190530.8

// Install Microsoft.Windows.CppWinRT as a Cake Tool
#tool nuget:?package=Microsoft.Windows.CppWinRT&version=2.0.190530.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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.

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.

Dependencies

This package has no dependencies.

NuGet packages (1)

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

Package Downloads
OneToolkit
OneToolkit provides a set of controls, converters and helpers that help you build modern Windows apps. This package provides the core OneToolkit functionality that's independent of any UI framework or app model.

GitHub repositories (10)

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

Repository Stars
microsoft/PowerToys
Windows system utilities to maximize productivity
microsoft/microsoft-ui-xaml
Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
UnigramDev/Unigram
Telegram for Windows 10
dotnet/sdk
Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
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.

Version History

Version Downloads Last updated
2.0.210722.2 565 7/22/2021
2.0.210714.1 471 7/14/2021
2.0.210709.3 381 7/9/2021
2.0.210708.4 1,656 7/8/2021
2.0.210707.1 201 7/7/2021
2.0.210629.4 823 6/30/2021
2.0.210629.2 146 6/29/2021
2.0.210624.2 527 6/24/2021
2.0.210621.3 835 6/21/2021
2.0.210621.2 85 6/21/2021
2.0.210505.3 5,069 5/6/2021
2.0.210504.3 894 5/4/2021
2.0.210503.1 839 5/3/2021
2.0.210427.2 478 4/27/2021
2.0.210403.2 6,638 4/4/2021
2.0.210329.4 989 3/29/2021
2.0.210326.8 332 3/26/2021
2.0.210326.4 144 3/26/2021
2.0.210312.4 65,933 3/12/2021
2.0.210312.3 111 3/12/2021
2.0.210309.3 1,290 3/10/2021
2.0.210304.5 740 3/4/2021
2.0.210304.4 121 3/4/2021
2.0.210301.1 547 3/1/2021
2.0.210225.3 462 2/26/2021
2.0.210211.2 5,481 2/12/2021
2.0.210122.3 5,812 1/23/2021
2.0.201217.4 28,127 12/17/2020
2.0.201215.2 352 12/15/2020
2.0.201201.7 772 12/9/2020
2.0.201113.7 41,729 11/13/2020
2.0.201102.2 7,003 11/2/2020
2.0.201026.4 545 10/26/2020
2.0.201017.1 12,370 10/18/2020
2.0.201008.2 2,007 10/8/2020
2.0.201006.7 528 10/7/2020
2.0.200921.6 15,885 9/21/2020
2.0.200917.4 814 9/18/2020
2.0.200729.8 71,120 7/29/2020
2.0.200728.4 481 7/29/2020
2.0.200703.9 36,673 7/4/2020
2.0.200630.5 8,224 6/30/2020
2.0.200630.4 300 6/30/2020
2.0.200615.7 135,269 6/16/2020
2.0.200609.3 2,175 6/9/2020
2.0.200602.3 5,988 6/2/2020
2.0.200602.2 208 6/2/2020
2.0.200601.2 289 6/1/2020
2.0.200531.2 346 6/1/2020
2.0.200514.2 9,819 5/14/2020
2.0.200512.4 838 5/12/2020
2.0.200511.2 616 5/11/2020
2.0.200508.4 582 5/8/2020
2.0.200316.3 104,784 3/16/2020
2.0.200303.2 1,221 3/5/2020
2.0.200302.1 12,986 3/2/2020
2.0.200224.2 1,666 2/24/2020
2.0.200213.5 253 3/5/2020
2.0.200203.5 13,690 2/3/2020
2.0.200203.3 295 2/3/2020
2.0.200117.5 18,375 1/17/2020
2.0.200116.6 1,130 1/16/2020
2.0.200115.8 612 1/15/2020
2.0.200107.1 982 1/7/2020
2.0.191217.1 6,339 12/18/2019
2.0.191202.6 26,068 12/2/2019
2.0.191202.4 268 12/2/2019
2.0.191202.2 273 12/2/2019
2.0.191111.2 5,298 11/11/2019
2.0.191029.4 1,758 11/7/2019
2.0.191023.3 284 11/7/2019
2.0.191018.6 2,747 10/18/2019
2.0.190730.2 105,728 7/30/2019
2.0.190729.1 377 7/29/2019
2.0.190722.3 4,226 7/22/2019
2.0.190712.2 693 7/12/2019
2.0.190710.3 6,373 7/12/2019
2.0.190620.2 19,663 6/21/2019
2.0.190605.7 21,754 6/6/2019
2.0.190603.8 2,379 6/3/2019
2.0.190603.6 356 6/3/2019
2.0.190603.5 352 6/3/2019
2.0.190603.4 350 6/3/2019
2.0.190530.8 5,457 5/31/2019
2.0.190529.9 36,318 5/29/2019
2.0.190506.1 19,612 5/6/2019
2.0.190425.5 6,588 4/25/2019
2.0.190417.3 60,768 4/17/2019
2.0.190408.1 8,456 4/8/2019
2.0.190405.3 472 4/5/2019
2.0.190404.8 1,718 4/5/2019
2.0.190402.6 688 4/3/2019
2.0.190401.2 393 4/2/2019
2.0.190329.3 455 4/2/2019
1.0.190211.5 10,724 2/11/2019
1.0.190205.2 8,798 2/10/2019
1.0.190128.4 679 2/10/2019
1.0.190111.3 1,050 4/6/2019
1.0.190109.2 12,539 1/9/2019
1.0.181129.3 6,468 11/29/2018
1.0.181115.3 758 11/15/2018
1.0.181108.4 613 11/9/2018
1.0.181002.2 2,356 10/3/2018
1.0.180914.4 685 9/14/2018
1.0.180913.3 611 9/13/2018
Show less