Migrate MSI and misc test projects to MSTest.Sdk on MTP#54882
Merged
Conversation
Migrates the following to MSTest.Sdk (Microsoft.Testing.Platform): - Microsoft.Win32.Msi.Tests - Microsoft.Win32.Msi.Manual.Tests - msbuild.Integration.Tests - Microsoft.WebTools.AspireService.Tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates several SDK test projects from xUnit to MSTest.Sdk (Microsoft.Testing.Platform), aligning them with the repo’s MSTest migration pattern and updating test attributes/assertions accordingly.
Changes:
- Convert
msbuild.Integration.Tests,Microsoft.Win32.Msi.Tests, andMicrosoft.WebTools.AspireService.Testsprojects toMSTest.Sdkand switch toMicrosoft.NET.TestFramework.MSTest. - Replace xUnit
[Fact]/[Theory]/[InlineData]with MSTest[TestMethod]/[DataRow]and add MSTest class annotations. - Update assertions and OS-gating to MSTest equivalents (e.g.,
OSCondition(OperatingSystems.Windows)).
Show a summary per file
| File | Description |
|---|---|
| test/msbuild.Integration.Tests/msbuild.Integration.Tests.csproj | Switch project to MSTest.Sdk and update test framework reference/usings. |
| test/msbuild.Integration.Tests/GivenDotnetInvokesMSBuild.cs | Convert xUnit tests to MSTest ([TestClass], [TestMethod], [DataRow]). |
| test/Microsoft.Win32.Msi.Tests/Microsoft.Win32.Msi.Tests.csproj | Switch project to MSTest.Sdk and update test framework reference/usings. |
| test/Microsoft.Win32.Msi.Tests/WindowsInstallerTests.cs | Convert theory-style tests to MSTest data-driven tests + OSCondition. |
| test/Microsoft.Win32.Msi.Tests/WindowsInstallerExceptionTests.cs | Convert theory-style tests to MSTest data-driven tests + OSCondition. |
| test/Microsoft.Win32.Msi.Tests/EventArgsTests.cs | Convert [WindowsOnlyFact] tests to MSTest + OSCondition and update assertions. |
| test/Microsoft.Win32.Msi.Manual.Tests/Microsoft.Win32.Msi.Manual.Tests.csproj | Remove now-unneeded “global usings removal” block. |
| test/Microsoft.WebTools.AspireService.Tests/Microsoft.WebTools.AspireService.Tests.csproj | Switch from Microsoft.NET.Sdk.Web to MSTest.Sdk, add Microsoft.AspNetCore.App framework reference, update test framework reference/usings. |
| test/Microsoft.WebTools.AspireService.Tests/RunSessionRequestTests.cs | Convert [Fact] to [TestMethod] and switch away from xUnit helper usage. |
| test/Microsoft.WebTools.AspireService.Tests/AspireServerServiceTests.cs | Convert xUnit tests to MSTest and adapt logging/cancellation to TestContext. |
Copilot's findings
- Files reviewed: 10/10 changed files
- Comments generated: 1
This was referenced Jun 19, 2026
MTP (MSTest.Sdk) test apps were always invoked via 'dotnet exec <target>'. For .NET Framework targets TargetPath is the native '.exe', which has no runtimeconfig.json, so 'dotnet exec' treats it as a self-contained .NET Core app and fails with 'hostpolicy.dll ... not found' (exit -2147450749). Launch the .exe directly for .NETFramework while keeping 'dotnet exec <dll>' for .NET (Core). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ServiceTests Pass the test's CancellationToken into WaitForListeningAsync instead of relying on the experimental TestContext.Current, removing the file-wide #pragma warning disable MSTESTEXP. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/ba-g issue I have seen on a few PRs but not sure how to correctly create the related known build error (cc @MichaelSimons): Expected: Actual: |
JeremyKuhne
approved these changes
Jun 22, 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.
Migrates the MSI and miscellaneous test projects from xUnit to
MSTest.Sdkon Microsoft.Testing.Platform (MTP), following the established repo pattern.Projects:
Microsoft.Win32.Msi.TestsMicrosoft.Win32.Msi.Manual.Testsmsbuild.Integration.TestsMicrosoft.WebTools.AspireService.TestsPart of the xUnit -> MSTest migration effort. Each project builds cleanly; tests were not run as part of this change.