Fix potential assembly mismatches for Microsoft.TestPlatform.ObjectModel#54964
Closed
Evangelink wants to merge 1 commit into
Closed
Fix potential assembly mismatches for Microsoft.TestPlatform.ObjectModel#54964Evangelink wants to merge 1 commit into
Evangelink wants to merge 1 commit into
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 via central package management to the same version as the in-box Microsoft.TestPlatform.CLI, preventing transitive downgrade/overwrite scenarios in test SDK layout that can crash dotnet test due to VSTest assembly mismatches.
Changes:
- Add a central
PackageVersionentry forMicrosoft.TestPlatform.ObjectModel. - Tie
Microsoft.TestPlatform.ObjectModel’s version to$(MicrosoftTestPlatformCLIPackageVersion)to keep it aligned with in-box vstest. - Document the rationale in
Directory.Packages.props.
Show a summary per file
| File | Description |
|---|---|
| Directory.Packages.props | Adds a central transitive pin for Microsoft.TestPlatform.ObjectModel to match the in-box Microsoft.TestPlatform.CLI version and avoid runtime mismatches. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
Member
Author
This was referenced 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 withMissingMethodException: 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.
This is a standalone version of the change in #54952, branched from current
main(which already contains the unrelatedToolPackageInstanceTestsbuild-break fix), so it can land independently of that fork-based PR.