You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New Assert.DoesNotContain overloads break compilation if LangVersion=latest is not specified #11022
Assert.DoesNotContain overloads introduced in 4.4.0 break compilation when targeting anything but net10.0 if LangVersion=latest is not specified.
The same setup works with 4.3.3.
Version used
4.4.0
Steps To Reproduce
Create MSTest.Sdk project.
Change SDK version to 4.4.0.
Change TargetFramework to net8.0.
Comment out/delete LangVersion from the project.
Build the project.
Expected behavior
Project builds with no error.
Actual behavior
Build is broken:
error CS0121: The call is ambiguous between the following methods or properties: 'Microsoft.VisualStudio.TestTools.UnitTesting.Assert.DoesNotContain<T>(T, System.Collections.Generic.IEnumerable<T>, string?, string, string)' and 'Microsoft.VisualStudio.TestTools.UnitTesting.Assert.DoesNotContain<T>(T, System.Span<T>, string?, string, string)'
Thanks avivanoff! This is indeed a regression caused by adding a new overload (span). Older versions of the compiler are confused for arrays while new versions are good. We will provide a targeted fix.
Activity
Evangelink commentedon Sep 4, 2026
Thanks avivanoff! This is indeed a regression caused by adding a new overload (span). Older versions of the compiler are confused for arrays while new versions are good. We will provide a targeted fix.