diff --git a/src/Polyfills/Polyfill.cs b/src/Polyfills/Polyfill.cs new file mode 100644 index 0000000000..d00af935d5 --- /dev/null +++ b/src/Polyfills/Polyfill.cs @@ -0,0 +1,30 @@ +// + +#pragma warning disable + +// Binary-compatibility shim for the (now removed) Polyfill NuGet package. +// +// Older Microsoft.Testing extension assemblies (built before Polyfill switched to +// [Embedded] types) were compiled against `Polyfills.Polyfill.Deconstruct` and, through +// InternalsVisibleTo, bound that call to the copy declared in the core +// Microsoft.Testing.Platform assembly. When Polyfill was dropped, that method disappeared, +// so mixing a newer core with an older extension throws: +// System.MissingMethodException: Method not found: 'Void Polyfills.Polyfill.Deconstruct(...)'. +// Keeping this method on the [Embedded] Polyfill type (see ProcessExtensions.cs) restores the +// runtime binding without re-exposing the polyfill to source consumers. +// See https://github.com/microsoft/testfx/issues/9710. + +using System; +using System.Collections.Generic; + +namespace Polyfills; + +internal static partial class Polyfill +{ + [Obsolete("Binary-compatibility shim for pre-[Embedded] Polyfill extension assemblies (see https://github.com/microsoft/testfx/issues/9710). It has no source callers and MUST be removed in the next major version of Microsoft.Testing.Platform.")] + public static void Deconstruct(this KeyValuePair target, out TKey key, out TValue value) + { + key = target.Key; + value = target.Value; + } +}