-
Notifications
You must be signed in to change notification settings - Fork 122
Description
Recently, an update to CsWinRT required an increment to the AssemblyVersion of winrt.runtime.dll. Winrt.runtime.dll is distributed in the Microsoft.Windows.SDK.Net.Ref framework package, which is in turn integrated into the .NET SDK, which is in turn ingested into Visual Studio updates. Because of this, published updates to winrt.runtime.dll can significantly lag published updates of dependent CsWinRT projection assemblies such as Microsoft.WinUI.dll. This can result in build breaks due to assembly resolution.
Proposal: create an opt-in mode that enforces public availability of dependencies like winrt.runtime.dll. A project property like CsWinRTAssertAvailability would validate whether the AssemblyVersion of winrt.runtime.dll referenced by the locally configured .NET SDK is >= the AssemblyVersion of the CsWinRT nuget package's lib\net5.0\winrt.runtime.dll. If the comparison failed, the build would fail (cswinrt.exe would be prevented from executing).
The trail of breadcrumbs to establish the comparison:
- given the version of .NET SDK being used:
dotnet --version
5.0.203
- locate the corresponding .NET SDK root:
dotnet --list-sdks |findstr /c:"5.0.100 "
5.0.203 [C:\Program Files\dotnet\sdk]
- locate that .NET SDK's Microsoft.NETCoreSdk.BundledVersions.props file:
C:\Program Files\dotnet\sdk\5.0.203\Microsoft.NETCoreSdk.BundledVersions.props - scan the props file for the Microsoft.Windows.SDK.NET.Ref framework reference version:
TargetingPackVersion="10.0.19041.15" - locate the winrt.runtime.dll for that version of the nuget package:
D:\NUGET_PACKAGES\microsoft.windows.sdk.net.ref\10.0.19041.15\lib\WinRT.Runtime.dll