Skip to content

Releases: microsoft/cppwinrt

3.0.260520.1

22 May 01:09
55f1b45

Choose a tag to compare

Major additions and breaking changes

In addition to the usual bugfixes and enhancements, this first 3.0 release contains two major updates: support for C++20 modules, and support for deprecated pre-standard coroutines has been removed.

Removing pre-standard coroutines

C++/WinRT has removed support for the pre-standard coroutines via the /await compiler option and the <experimental/coroutine> header. This aligns with the new behavior in the MSVC Build Tools 14.50 (shipping in Visual Studio 2026) that officially deprecated /await, and will soon deprecate the experimental headers. Standard coroutines are available by default starting in C++20, or if you are still on C++17, use /await:strict.

If your existing projects are using the Nupkg support out of the box and have not manually added /await, you probably won't have to change anything, as we've updated the default behavior in Microsoft.Windows.CppWinRT.targets to use /await:strict when building with C++17. If for some reason, you need to override this default behavior in the targets file, you can set CppWinRTEnableCpp17Coroutines to false to prevent it from auto-setting /await:strict.

Module support

Full module support has finally arrived to C++/WinRT! Replace

#include <winrt/Windows.Foundation.h>

with

import winrt.Windows.Foundation;

and rejoice!

This brings potential improvements in build speed, disk space, and memory usage, particularly for large projects using Xaml projections, and starts to isolate more of the internal C++/WinRT implementation details from the consumer side. Test-driving this work on a quick and dirty prototype fork of Windows Terminal yielded a 10-15% build speed improvement (22 minutes before, 19 minutes after), and a reduction in disk space from 30GB down to 18GB.

If you've ever used C++/WinRT with Windows.UI.Xaml.*, you've probably moved those headers into your precompiled header (PCH), but then saw your PCH consume well upwards of 1-2GB of disk space per vcxproj, per flavor. In the Terminal prototype, taking these headers out of the PCH and replacing them with a single cppwinrt module, built once and shared between projects, the PCHs shrunk by upwards of 80%, and the time to build each PCH went from ~40 seconds down to ~5 seconds. The single prebuilt cppwinrt modules carried all of the types for the entire Windows.* namespaces and WinUI, and still consumed only 700MB, and took ~80-90 seconds to build. Excluding unused namespaces from the module build can lower those numbers even further. The Terminal prototype didn't do this, and still enjoyed immediate wins on disk space, and the build time wins broke even after converting about 2-3 projects out of the ~15 or so that use C++/WinRT.

As part of this large effort, we no longer generate the old monolithic module interface file winrt.ixx, but instead generate a module interface .ixx file for each WinRT namespace. There is more documentation at nuget/modules/md to help get you started.

What's changed

New Contributors

Full Changelog: 2.0.250303.1...3.0.260520.1

2.0.250303.1

29 May 21:54
69c78cf

Choose a tag to compare

What's Changed

  • Use actions/cache@v4 by @jsoref in #1411
  • Spelling by @jsoref in #1412
  • Changed visibility of observable_map_base::call_changed to protected by @Patschkowski in #1425
  • Add missing <exception> to base_includes.h by @m417z in #1427
  • Add NuGet config by @manodasanW in #1433
  • Update NuGetCommand to use nuget.config by @manodasanW in #1434
  • Clarify how InitializeComponent works in the template comment by @la-thorn in #1435
  • Silence clang-tidy "unused variable" warnings by @dunhor in #1438
  • Value-init fields of WinRT structs (fix warning C24695 in generated code) by @DefaultRyan in #1443
  • Bug: Projected winrt::consume_ methods will nullptr crash if the underlying QueryInterface call fails by @dmachaj in #1442
  • WINRT_SOURCE_LOCATION has ODR checks that prevent mixing cpp17 and cpp20 static libraries by @dmachaj in #1444
  • Latest vpack has an extra cppwinrt folder by @DefaultRyan in #1447
  • Reduce the code size of generated consume methods by skipping casts when the type is already a match by @dmachaj in #1448
  • try_as casts should not store COM error context; consume method cast checking should use return codes directly by @dmachaj in #1450
  • Try to fix the disabled/failing nuget test build step by @dmachaj in #1451
  • GitHub Actions workflow cannot build arm32 after updating Windows SDK by @dmachaj in #1454
  • The new variables in winrt::impl::consume_ methods can collide with parameters to that method by @dmachaj in #1455
  • Fix overloads coming from overridable interfaces by @sylveon in #1458
  • Make consume methods more amenable to optimization by @DefaultRyan in #1462
  • Fix warnings in natvis project by @DefaultRyan in #1463
  • Fix reading past end of array. by @dlech in #1468
  • Fix setting of IntDir MSBuild property by @DefaultRyan in #1471
  • Allow visualization of properties on generic types by @DefaultRyan in #1472
  • Fix various build warnings by @DefaultRyan in #1473
  • Configure guardian, SDL, TSA, and CodeQL in Official Builds by @DefaultRyan in #1474
  • Clean up more warnings and Component Governance by @DefaultRyan in #1475
  • Stop manually downloading hardcoded version of llvm/clang. by @DefaultRyan in #1478
  • Enable prefast and warnings checker in SDL by @DefaultRyan in #1477
  • Merge compiler and msbuild vpacks by @DefaultRyan in #1479
  • Fix vpack clobbering and update to newer Windows container image by @DefaultRyan in #1480

New Contributors

Full Changelog: 2.0.240405.15...2.0.250303.1

2.0.240405.15: Remove references to stale winmd files to fix incremental builds (#1404)

05 Apr 22:37
d2a6677

Choose a tag to compare

Changes:

  • d2a6677 Remove references to stale winmd files to fix incremental builds (#1404)
  • e03bdc4 Use latest upload/download actions (#1410)
  • 17d095a Fix build following dependabot updates (#1409)
  • 2b8fe6e Revert "Bump actions/upload-artifact from 3 to 4 (#1407)"
  • ea18769 Bump actions/download-artifact from 3 to 4 (#1408)
  • 6f74952 Bump actions/upload-artifact from 3 to 4 (#1407)
  • 523eda7 Bump actions/stale from 6 to 9 (#1405)
  • dfad7ed Bump actions/checkout from 3 to 4 (#1406)
  • f0ce6c6 Create dependabot.yml
  • adc6ef9 TDBuild - updating localized resource files.
See More

This list of changes was auto generated.

2.0.240111.5: Update build.yml for Azure Pipelines (#1384)

12 Jan 05:37
25a14f8

Choose a tag to compare

Changes:

See More

This list of changes was auto generated.

2.0.230706.1: Allow classic COM interfaces with get_self (#1314)

06 Jul 20:34
297454e

Choose a tag to compare

Changes:

This list of changes was auto generated.

2.0.230524.4

25 May 01:07
0e740b1

Choose a tag to compare

Changes:

This list of changes was auto generated.

2.0.230524.3

24 May 22:37
4587264

Choose a tag to compare

Changes:

  • 4587264 Remove explicitly setting PreferredToolArchitecture, since VS 2022 handles this more comprehensively (#1304)
  • 49b2cab Remove ARM OneBranch build workaround (#1303)
  • 65581a3 Add capture support for unconventional result types (#1301)
  • c3b7fcf Move official build pipelines to OneBranch (#1295)
  • 6162c9d Fix flakey clock and line-number tests (#1294)
  • a1b9593 Use safe DLL loading (avoid current directory) (#1293)
  • 737adea Compliance and test cleanup (#1291)
  • f3c7309 Expose configuring /nomidl. (#1290)
  • 9e89b5c Create pipeline to sync mirror repo (#1286)
  • 629f9e7 Update README.md

This list of changes was auto generated.

2.0.230225.1

25 Feb 17:59
72b30cc

Choose a tag to compare

What's Changed

  • Stack usage reduction in apartment switching, and lifetime fixes by @oldnewthing in #1272
  • Reduce stack consumption if unable to switch to apartment_context by @oldnewthing in #1276
  • Fix unreliable clock epoch tests by @oldnewthing in #1277
  • to_hstring for IStringable by @JaiganeshKumaran in #1271
  • Add a clang-specific impl->projection conversion operator by @DHowett in #1274

New Contributors

Full Changelog: 2.0.230207.1...2.0.230225.1

2.0.230207.1

07 Feb 19:51
3bbee2c

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 2.0.221121.5...2.0.230207.1

2.0.221121.5

21 Nov 19:46
530d383

Choose a tag to compare

What's Changed

Full Changelog: 2.0.221117.1...2.0.221121.5