Repository navigation
Fix System.MissingMethodException for KeyValuePair Deconstruction - #5633
Youssef Fahmy (Youssef1313) with Copilot wants to merge 4 commits into
Conversation
…yfill Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
|
Jakub Jareš (@nohwnd) While it's still mysterious why restore isn't behaving as we would expect in the original issue, and we didn't get a binlog from the customer, I think this change is reasonable enough to avoid potential issues. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5633 +/- ##
==========================================
- Coverage 76.51% 74.05% -2.46%
==========================================
Files 602 602
Lines 36561 36560 -1
==========================================
- Hits 27974 27074 -900
- Misses 8587 9486 +899
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/backport to rel/3.9 |
|
Started backporting to rel/3.9: https://github.com/microsoft/testfx/actions/runs/15195038006 |
|
I think it's too fragile to allow MSTest.TestAdapter netstandard2.0 assembly to be used with MSTest.TestFramework. I'm going to close this PR. The backport was merged already but it doesn't harm as well. |
Overview
This PR addresses an issue where tests fail with a
System.MissingMethodExceptionwhen using MSTest v3.8.3 with .NET 6 projects. The error occurs because tuple deconstruction ofKeyValuePair<TKey,TValue>requires thePolyfills.Polyfill.Deconstructmethod, which is not available in the netstandard2.0 version of the assembly when used with .NET 6 projects.Problem
The error occurs in the following scenario:
Error message:
Changes
The changes replace tuple deconstruction pattern with traditional KeyValuePair access:
In TestExecutionManager.cs:
foreach ((TestProperty key, object? value) in tcmProperties)to use standard KeyValuePair syntaxforeach ((string key, object value) in sourceLevelParameters)to use standard KeyValuePair syntaxIn TestRunCancellationToken.cs:
In DeploymentItemUtility.cs:
foreach ((string? key, string? value) in deploymentItemsData)to use standard KeyValuePair syntaxThese changes avoid the need for the Polyfill.Deconstruct method while maintaining the same functionality.
Fixes #5579.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
pkgs.dev.azure.com/home/REDACTED/work/testfx/testfx/.dotnet/dotnet msbuild /m /nologo /clp:Summary /v:minimal /nr:true /warnaserror /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /home/REDACTED/work/testfx/testfx/artifacts/toolset/restore.proj /t:__WriteToolsetLocation /clp:ErrorsOnly;NoSummary /p:__ToolsetLocationOutputFile=/home/REDACTED/work/testfx/testfx/artifacts/toolset/10.0.0-beta.25229.4.txt(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.