Fix potential assembly mismatches for Microsoft.TestPlatform.ObjectModel#54952
Merged
Evangelink merged 2 commits intoJun 24, 2026
Merged
Conversation
Microsoft.Testing.Extensions.VSTestBridge (pulled in transitively by test projects using MSTest.Sdk/MTP) requests an older Microsoft.TestPlatform.ObjectModel than the in-box vstest shipped by Microsoft.TestPlatform.CLI. Because test projects build into the test SDK layout, that older ObjectModel (and the CoreUtilities / PlatformAbstractions assemblies in the same package) overwrites the newer in-box vstest assemblies, causing 'dotnet test' (VSTest mode) to crash with MissingMethodException: RunConfiguration.get_CreateNoNewWindow. With central package transitive pinning enabled, adding a PackageVersion entry pins the transitive ObjectModel to the in-box vstest version so the two stay in sync. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Pins Microsoft.TestPlatform.ObjectModel to the same version as the in-box VSTest shipped via Microsoft.TestPlatform.CLI, preventing transitive dependencies (notably from Microsoft.Testing.Extensions.VSTestBridge) from bringing older TestPlatform assemblies that can overwrite the in-box copies and break dotnet test.
Changes:
- Add a central
PackageVersionentry forMicrosoft.TestPlatform.ObjectModelusing$(MicrosoftTestPlatformCLIPackageVersion). - Document the rationale in
Directory.Packages.propsto clarify why this transitive pin is needed.
Evangelink
approved these changes
Jun 24, 2026
Member
|
/ba-g the test failures are present on main and various PRs |
Evangelink
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pin Microsoft.TestPlatform.ObjectModel to the in-box vstest version
Microsoft.Testing.Extensions.VSTestBridge (pulled in transitively by test projects using MSTest.Sdk/MTP) requests an older Microsoft.TestPlatform.ObjectModel than the in-box vstest shipped by Microsoft.TestPlatform.CLI. Because test projects build into the test SDK layout, that older ObjectModel (and the CoreUtilities / PlatformAbstractions assemblies in the same package) overwrites the newer in-box vstest assemblies, causing 'dotnet test' (VSTest mode) to crash with MissingMethodException: RunConfiguration.get_CreateNoNewWindow.
With central package transitive pinning enabled, adding a PackageVersion entry pins the transitive ObjectModel to the in-box vstest version so the two stay in sync.