Skip to content

CsWinRT v1.4.1

Compare
Choose a tag to compare
@Scottj1s Scottj1s released this 18 Nov 19:07
f8d506b

Release Notes

#f03c15 NOTE: Please see breaking change notice below, regarding dependent projections (Windows SDK and Windows App SDK). Updating to this version requires one of the following .NET SDK versions (or later): 5.0.210, 5.0.404, or 6.0.101.

This release of C#/WinRT includes several updates to the runtime and Windows SDK projections particularly with performance. This release also includes a preview of embedded support. For a detailed list of fixes and updates, refer to the Release 1.4.1 Milestone.

C#/WinRT package

https://www.nuget.org/packages/Microsoft.Windows.CsWinRT/1.4.1

.NET Windows SDK targeting packages:

The following updated Windows SDK packages are available in .NET SDK 5.0.210, .NET SDK 5.0.404, and .NET SDK 6.0.101. See Call Windows Runtime APIs in desktop apps for more details on using these packages.

https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref/10.0.22000.22
https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref/10.0.20348.22
https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref/10.0.19041.22
https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref/10.0.18362.22
https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref/10.0.17763.22

Breaking changes

This version of C#/WinRT includes AssemblyVersion changes in both the runtime and generated Windows SDK projection assemblies:

  • WinRT.Runtime.dll: AssemblyVersion incremented from 1.3.0.0 to 1.4.0.0
  • Microsoft.Windows.SDK.NET.dll: AssemblyVersion incremented from 10.0.xxxxx.21 to 10.0.xxxxx.22

The AssemblyVersion changes are due to the fact that this version of C#/WinRT generates new helper methods for non-exclusive interfaces which are consumed by the generated code of a type implementing that interface. The impact of the AssemblyVersion changes is that components/projections that are built using this version of C#/WinRT and that implement interfaces from another projection (e.g., the Windows SDK or WinUI projection) will need an updated version of the other projection built using this version of C#/WinRT. Otherwise, you may see errors similar to the following:

Error CS0234: The type or namespace name 'IGraphicsEffectMethods' does not exist in the namespace 'ABI.Windows.Graphics.Effects' (are you missing an assembly reference?)

Performance improvements

  • Minimize usage of IDynamicInterfaceCastable: Improves performance in RCW function calls and reduces number of objects being created (#1015)
  • Optimize activation factory caching to always pin for life of the process (#1021)
  • Reduce cost of subscribing to events (#1027)
  • Initialize generic marshaller helper functions lazily to reduce reflection code (#1001)
  • Minimize Lazy<> usage and replace with Interlocked.CompareExchange (#1014)
  • Reduce redundant activation factory lookup (#1001)
  • Lazy creation of concurrent dictionaries (#1001)
  • Improve activation for string operations and dictionaries (#1006)
  • Cache IsWindowsRuntimeType (type marshalling improvements) (#1005)
  • CreateObject microbenchmark optimizations (reduce time spent during RCW creation and improvements in drawing) (#1010)
  • Dictionary lookup caching (#1033)

Additional perf improvements after 1.4.0-prerelease.211028.1:

  • String marshaling optimizations (#1036)
  • Improved performance for invoking events (#1042)
  • GetObjectReferenceForInterface improvements (#1046)
  • Reduce usage of GetRuntimeClassName (#1043)

Embedded support

This version of C#/WinRT includes a preview of embedded support. This provides support for compiling runtime and projection sources into your library/app output. For more information, refer to the docs, samples, and related issue #304 .

Bug fixes

  • Issue fixed where embedded quotes in custom attributes break the projection (#1037)
  • Issue fixed where second event handler not called (#626)

Changes:

See More
  • 8806f83 Link to Github discussions and update readme for contributing (#1035)
  • a0b8c37 Embedded sources: cswinrt (#1009)
  • 72b1236 Embedded sources: WinRT.Runtime (#1008)
  • fee2cb9 Dictionary lookup caching (#1033)
  • ad77248 Refactor Lazy<> uses (#1014)
  • 5fac5ad Update .NET SDK versions (#1030)
  • b8d4b5e Improvements to subscribing to events (#1027)
  • db7a841 Fix the FastUpToDateCheck relationship between WinRT.cs and the inputs winmds. (#1026)
  • 7dc015e Merge pull request #1015 from microsoft/ujjwalchadha/minimize_idic_usage
  • 298ae4b cleanup
  • 2378340 Merged master
  • 4427779 Update nuspec tags and description
  • 86f37b7 Make activation factories not weak and reduce duplicate retrieval of activation factories (#1021)
  • d2fb501 Fix private class methods
  • 375b8b9 Use targetframework property function (#1012)
  • 51a2183 Ensure AssemblyAttributes.cs file is generated with correct TargetFrameworkAttribute (#1020)
  • ee17bea Bump TestWinRT version (#1019)
  • 41beec2 Fix build with VS2022 (#1017)
  • 4035ab8 Convert activation and error info delegates to function pointers (#1018)
  • a32c457 CreateObject microbenchmark optimizations (#1010)
  • 66f4c01 Merge branch 'master' into ujjwalchadha/minimize_idic_usage
  • 0b13794 Refactor code_writers
  • ffb3267 projection code cleanup
  • 625f534 Remove idic use from static classes
  • e8a806d Call static methods from classes
  • bd25372 Cache IsWindowsRuntimeType, which is expensive to read custom attributes (#1005)
  • 565de2f CompareOrdinal all the things - string operations and dictionaries (#1006)
  • 7c2667b Move abi calls to static classes
  • a69a7ed Handle case where event source may remove event and any other added events don't fire (#997)
  • 54c6bfc Perf improvements (#1001)
  • c927df0 fixed a few assumptions regarding nuget cache (#1002)

This list of changes was auto generated.