Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 11, 2025

The ManagedWinRTComponentCanBeReferenced test was failing in CI due to missing Platform.xml for Windows SDK 10.0.19041.0.

Changes

  • Updated TargetFrameworks from windows10.0.19041.0 to windows10.0.26100.0
  • Updated CsWinRTWindowsMetadata property to match the new SDK version
  • Removed explicit WindowsSdkPackageVersion property (no longer needed)

The newer SDK version should be available on CI infrastructure, allowing the test to pass.

Original prompt

This section details on the original issue you should resolve

<issue_title>Skipped test: Microsoft.NET.Build.Tests.GivenThatWeWantToBuildAWindowsRuntimeComponent.ManagedWinRTComponentCanBeReferenced</issue_title>
<issue_description>Related: #51935
Related: #51934

Summary

This test was failing in the release/10.0.1xx and main branch for:

  • FullFramework: windows (x64)
  • TestBuild: windows (x64)

Error Log

[xUnit.net 00:00:16.42]     Microsoft.NET.Build.Tests.GivenThatWeWantToBuildAWindowsRuntimeComponent.ManagedWinRTComponentCanBeReferenced [FAIL]
[xUnit.net 00:00:16.42]       Expected value to be 0 because Expected command to pass but it did not.
[xUnit.net 00:00:16.42]       Working Directory:
[xUnit.net 00:00:16.42]       File Name: C:\h\w\A5D1090F\p\d\dotnet.exe
[xUnit.net 00:00:16.42]       Arguments: msbuild /t:Build C:\h\w\A5D1090F\t\dotnetSdkTests\ltosyl1k.kit\ManagedWinRTC---79256FB9\ConsoleApp\ConsoleApp.csproj /restore
[xUnit.net 00:00:16.42]       Exit Code: 1
[xUnit.net 00:00:16.42]       StdOut:
[xUnit.net 00:00:16.42]       MSBuild version 18.0.6+5ddd0ddc0 for .NET
[xUnit.net 00:00:16.42]         Determining projects to restore...
[xUnit.net 00:00:16.42]         Restored C:\h\w\A5D1090F\t\dotnetSdkTests\ltosyl1k.kit\ManagedWinRTC---79256FB9\ConsoleApp\ConsoleApp.csproj (in 3.71 sec).
Running C:\h\w\A5D1090F\p\d\dotnet.exe msbuild /t:Build C:\h\w\A5D1090F\t\dotnetSdkTests\ltosyl1k.kit\It_fails_when---0E5A998A\WinMDClasslibrary\WinMDClasslibrary.csproj /restore
[xUnit.net 00:00:16.42]         Restored C:\h\w\A5D1090F\t\dotnetSdkTests\ltosyl1k.kit\ManagedWinRTC---79256FB9\ManagedWinRTComponent\ManagedWinRTComponent.csproj (in 3.71 sec).
[xUnit.net 00:00:16.42]       C:\h\w\A5D1090F\p\d\sdk\10.0.102-ci\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(351,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\h\w\A5D1090F\t\dotnetSdkTests\ltosyl1k.kit\ManagedWinRTC---79256FB9\ConsoleApp\ConsoleApp.csproj]
[xUnit.net 00:00:16.42]       EXEC : error : Could not read the Windows SDK's Platform.xml at C:\Program Files (x86)\Windows Kits\10\Platforms\UAP\10.0.19041.0\Platform.xml [C:\h\w\A5D1090F\t\dotnetSdkTests\ltosyl1k.kit\ManagedWinRTC---79256FB9\ManagedWinRTComponent\ManagedWinRTComponent.csproj]
[xUnit.net 00:00:16.42]       C:\h\w\A5D1090F\t\dotnetSdkTests\ltosyl1k.kit\.nuget\packages\microsoft.windows.cswinrt\2.1.1\build\Microsoft.Windows.CsWinRT.targets(290,5): error MSB3073: The command ""C:\h\w\A5D1090F\t\dotnetSdkTests\ltosyl1k.kit\.nuget\packages\microsoft.windows.cswinrt\2.1.1\cswinrt.exe" @"C:\h\w\A5D1090F\t\dotnetSdkTests\ltosyl1k.kit\ManagedWinRTC---79256FB9\ManagedWinRTComponent\obj\Debug\net10.0-windows10.0.19041.0\Generated Files\CsWinRT\cswinrt.rsp"" exited with code 1. [C:\h\w\A5D1090F\t\dotnetSdkTests\ltosyl1k.kit\ManagedWinRTC---79256FB9\ManagedWinRTComponent\ManagedWinRTComponent.csproj]
[xUnit.net 00:00:16.42]       StdErr:
[xUnit.net 00:00:16.42]       
[xUnit.net 00:00:16.42]       , but found 1 (difference of 1).
[xUnit.net 00:00:16.42]       Stack Trace:
[xUnit.net 00:00:16.43]            at FluentAssertions.Execution.LateBoundTestFramework.Throw(String message)
[xUnit.net 00:00:16.43]            at FluentAssertions.Execution.DefaultAssertionStrategy.HandleFailure(String message)
[xUnit.net 00:00:16.43]            at FluentAssertions.Execution.AssertionScope.AddPreFormattedFailure(String formattedFailureMessage)
[xUnit.net 00:00:16.43]            at FluentAssertions.Execution.AssertionChain.FailWith(Func`1 getFailureReason)
[xUnit.net 00:00:16.43]            at FluentAssertions.Execution.AssertionChain.FailWith(Func`1 getFailureReason)
[xUnit.net 00:00:16.43]            at FluentAssertions.Execution.AssertionChain.FailWith(String message, Object[] args)
[xUnit.net 00:00:16.43]            at FluentAssertions.Numeric.NumericAssertionsBase`3.Be(T expected, String because, Object[] becauseArgs)
[xUnit.net 00:00:16.43]         /_/test/Microsoft.NET.TestFramework/Assertions/CommandResultAssertions.cs(27,0): at Microsoft.NET.TestFramework.Assertions.CommandResultAssertions.Pass()
[xUnit.net 00:00:16.43]         /_/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsRuntimeComponent.cs(186,0): at Microsoft.NET.Build.Tests.GivenThatWeWantToBuildAWindowsRuntimeComponent.ManagedWinRTComponentCanBeReferenced()
[xUnit.net 00:00:16.43]            at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
[xUnit.net 00:00:16.43]            at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
[xUnit.net 00:00:16.43]            at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
[xUnit.net 00:00:16.43]       Output:
[xUnit...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes dotnet/sdk#52032

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

Copilot AI changed the title [WIP] Fix skipped test for ManagedWinRTComponent reference Update ManagedWinRTComponentCanBeReferenced test to Windows SDK 10.0.26100.0 Dec 11, 2025
Copilot AI requested a review from dsplaisted December 11, 2025 16:08
@dsplaisted dsplaisted marked this pull request as ready for review December 11, 2025 17:34
@dsplaisted dsplaisted requested a review from a team December 11, 2025 17:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the ManagedWinRTComponentCanBeReferenced test that was failing in CI due to missing Platform.xml for Windows SDK 10.0.19041.0. The test is updated to use Windows SDK 10.0.26100.0, which is available on CI infrastructure and already in use in other test files.

Key Changes:

  • Updated Windows SDK version from 10.0.19041.0 to 10.0.26100.0 for both TargetFrameworks and CsWinRTWindowsMetadata properties
  • Removed obsolete WindowsSdkPackageVersion property that was marked as temporary

@dsplaisted dsplaisted merged commit 32c515a into main Dec 11, 2025
29 of 30 checks passed
@dsplaisted dsplaisted deleted the copilot/fix-skipped-tests-managed-winrt branch December 11, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants