This is a stable minor version release for 2.x with the various fixes and improvements that have been available in our CsWinRT 2.3 previews. We will also be updating the .NET SDK with these updated Windows SDK projections. Below are some notable highlights included in this release. See the full commit list below for the complete set of changes.
- Dropped support for .NET 6 and .NET 7
- Added a .NET 9 version of WinRT.Runtime.dll which enables marshalling of non-blittable arrays under Native AOT
- Added support for collection expressions including an analyzer to warn for unsupported scenarios
- Improvements to exception propagation to include a default message
- Fixed scenarios where the
SupportedOSPlatformattribute was not being projected as expected - Fixed issues with unsubscribing from events on non-agile objects
- Added a
CsWinRTAotWarningLevel = 3for more extensive AOT warnings with respect to casting scenarios. These warnings can be noisy, so they are not enabled by default. - Added a way to suppress AOT
partialwarnings for certain interfaces using thecswinrt_aot_warning_suppressed_interfaceseditor config option.
.NET Windows SDK targeting packages for .NET 8:
<WindowsSdkPackageVersion>10.0.xxxxx.86</WindowsSdkPackageVersion>https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref/10.0.26100.86
https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref/10.0.22621.86
https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref/10.0.22000.86
https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref/10.0.20348.86
https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref/10.0.19041.86
https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref/10.0.18362.86
https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref/10.0.17763.86
.NET Windows SDK targeting packages for .NET 9 / 10:
<WindowsSdkPackageVersion>10.0.xxxxx.87</WindowsSdkPackageVersion>https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref/10.0.26100.87
https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref/10.0.22621.87
https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref/10.0.22000.87
https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref/10.0.20348.87
https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref/10.0.19041.87
https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref/10.0.18362.87
https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref/10.0.17763.87
C#/WinRT package:
https://www.nuget.org/packages/Microsoft.Windows.CsWinRT/2.3.1
What's Changed
- Fix AnalyzerReleases.Shipped typo by @dotMorten in #1868
- Remove .NET 6 target from all projects by @Sergio0694 in #1875
- Fix CI by @manodasanW in #1879
- Update staging/2.3 from main by @Sergio0694 in #1882
- Improved Diagnostics for error scenarios with authoring projects by @chenss3 in #1863
- Skip closure allocation in IDIC caching by @Sergio0694 in #1888
- Make 'CreateIIDForGenericType' zero-alloc by @Sergio0694 in #1889
- Enable support for C# collection expressions by @Sergio0694 in #1878
- Add 'CsWinRTEnableManifestFreeActivation' feature switch by @Sergio0694 in #1887
- Implement stub .exe support for apps + WinRT components by @Sergio0694 in #1895
- Fix IDIC casts failing during authoring scenarios by @manodasanW in #1899
- Fix projected covariance interfaces by @manodasanW in #1902
- Merge master to staging/2.3 by @manodasanW in #1905
- Document AotOptimizerEnabled and GeneratedWinRTExposedTypeAttribute by @dongle-the-gadget in #1910
- [CodeQL] suppress usage of SHA1 in uuidv5 generation of WinRT pinterface guids by @DefaultRyan in #1911
- Fix adding error info object to Exception.Data on net framework by @manodasanW in #1916
- Add mapping from COR_E_INVALIDOPERATION by @manodasanW in #1920
- Add mapping for 'E_NOTSUPPORTED' by @Sergio0694 in #1921
- Update staging/2.3 by @manodasanW in #1924
- Enable adding GC pressure on Native AOT by @Sergio0694 in #1933
- Enable propagating WinRTRuntimeClassName value to activation factory lookup by @manodasanW in #1934
- Update staging with latest changes from master by @manodasanW in #1935
- Add analyzer for '[ComImport]' casts on AOT by @Sergio0694 in #1927
- Avoid `QueryInterface' + 'Release' when wrapping managed CCWs by @Sergio0694 in #1938
- Don't use legacy 'ComWrappers' overload for COM aggregation by @Sergio0694 in #1945
- Remove unused internal 'IPropertyValue' and IDIC support by @Sergio0694 in #1937
- Add .NET 9 target for WinRT.Runtime.dll by @Sergio0694 in #1843
- Add analyzer for trim-unsafe casts to projected runtime class types by @Sergio0694 in #1956
- Migrate pipeline by @manodasanW in #1957
- ReleaseObjects should safely handle non projected RCWs by @manodasanW in #1958
- Fix signing location by @manodasanW in #1960
- Add attribute and code fixer for trim-unsafe casts by @Sergio0694 in #1959
- Central package management by @manodasanW in #1962
- Add TSA override by @manodasanW in #1964
- Improve CI build by @manodasanW in #1966
- Fix KeyValuePair pointer reuse issue by @manodasanW in #1967
- Avoid GetFunctionForDelegate call in delegate vtables by @manodasanW in #1971
- Add option to generate managed DllGetActivationFactory by @manodasanW in #1973
- Merge master to staging branch by @manodasanW in #1972
- Remove CsWinRTErrorForInvalidMergeReferencedActivationFactories error which doesn't apply anymore by @manodasanW in #1970
- Don't report RPC errors for completion handlers due to the other process is gone by @manodasanW in #1969
- Move source generator tests by @manodasanW in #1975
- Fix signing by @manodasanW in #1976
- Skip lambda allocation in 'EventSourceCache' by @Sergio0694 in #1977
- Sign winmd and MUI files by @manodasanW in #1978
- Moving CsWinRTGenerateManagedDllGetActivationFactory to right target by @manodasanW in #1991
- Embed manifest in stub exe if provided by @jevansaks in #1992
- Stub exe generation fails with a manifest if CsWinRTUseEnvironmentalTools=false by @jevansaks in #1994
- Don't ignore 'TryRemove' result in event cache by @Sergio0694 in #1980
- Update cast analyzer to handle switch statement patterns by @Sergio0694 in #2004
- Fix vtables not being generated for GeneratedBindableCustomPropertyAttribute classes by @manodasanW in #2010
- Handle 'IWeakReferenceSource' in 'ICustomQueryInterface' by @Sergio0694 in #2011
- Fix scenario where one authoring component project references another by @manodasanW in #2003
- Update custom property implementations to use fully qualified name with global by @manodasanW in #2012
- Escape assembly name when starting with number by @manodasanW in #2013
- Update hosting support to allow loading in default ALC by @manodasanW in #2014
- Disable and trim 'Marshaler' on Native AOT by @Sergio0694 in #1907
- Add IReferenceArray support for built-in types on AOT by @manodasanW in #2019
- Merge to staging/2.3 by @manodasanW in #2021
- Fix warning by @manodasanW in #2023
- Use FormatMessage for exception messages in cases where the stowed/language exception doesn't contain a message by @ahmed605 in #2022
- Merge to staging/2.3 by @manodasanW in #2025
- Merge staging/2.3 to master by @manodasanW in #2030
- Fix 'Initialize' typo in several files by @Lightczx in #2035
- Fix design time build error causing incremental build issue by @manodasanW in #2036
- Move TestWinRT repo clone to resource by @manodasanW in #2032
- Fix weak reference rehydration scenarios for non projected types by @manodasanW in #2043
- Add UpToDateCheckBuilt to cover incremental build of Implementation dlls by @jevansaks in #2051
- Fix issue where IReferenceArray is not being found by @manodasanW in #2071
- Fix issue with unsubscribing from events on non-agile objects by @manodasanW in #2079
- Fix issues with CopyToManagedArray by @manodasanW in #2084
- Update package versions by @manodasanW in #2134
- Moving to using embedded pdbs by @manodasanW in #2138
- Fix pipeline by @manodasanW in #2280
- Provide a way to disable the NotSupportedException diagnostics we provide for bindings without the attribute by @manodasanW in #2325
- Fix CCW detection for constructor parameters by @Sergio0694 in #2339
- Update idl for interop APIs to reflect actual object being returned by @manodasanW in #2349
- Skip INotifyPropertyChanging in authoring generator to fix CsWinRT1031 by @Sergio0694 in #2358
- Remove WinRT.Host.Shim.dll from .NET 9 folder by @manodasanW in #2229
- Guard against MissingMetadataReference throwing FileNotFoundException by @manodasanW in #2368
- Embiggen the printf formatting buffer by @jonwis in #2379
- Fix overridable properties by @manodasanW in #2380
- Handle COM disconnect errors when cancelling WinRT async operations by @Sergio0694 in #2399
- Fix missing [SupportedOSPlatform] on projected members for newer SDK versions by @Sergio0694 in #2381
- Fix scenarios where authoring types are ending up in CreateFactoryForImplementationType by @manodasanW in #2421
- Provide a way to suppress AOT partial warnings for certain interfaces by @manodasanW in #2455
- Handle ternary, switch, and cast expressions in AOT CCW discovery by @Sergio0694 in #2480
- Fix SupportedOSPlatform attributes for Desktop extension SDK by @manodasanW in #2484
Full Changelog: 2.2.0.241111.1...2.3.1.260716.1