Skip to content

Clarify MSTest.Sdk incompatibility with ASP.NET Core (Microsoft.NET.Sdk.Web)#54554

Open
Copilot wants to merge 5 commits into
mainfrom
copilot/how-to-write-integration-tests-mstest-sdk
Open

Clarify MSTest.Sdk incompatibility with ASP.NET Core (Microsoft.NET.Sdk.Web)#54554
Copilot wants to merge 5 commits into
mainfrom
copilot/how-to-write-integration-tests-mstest-sdk

Conversation

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

The "Enable MTP in an MSTest project" section didn't explain that MSTest.Sdk replaces Microsoft.NET.Sdk as the project SDK—making it incompatible with ASP.NET Core integration test projects that require Microsoft.NET.Sdk.Web. The "alternatively" paragraph also didn't make clear when to use manual configuration over the SDK approach.

Changes

  • Rewrote intro paragraph — Direct imperative form; explicitly states that MSTest.Sdk replaces Microsoft.NET.Sdk as the project SDK with MTP enabled by default.
  • Added NOTE callout — Calls out that MSTest.Sdk isn't compatible with projects requiring a different SDK, with Microsoft.NET.Sdk.Web (ASP.NET Core) as the concrete example.
  • Rewrote the "alternatively" paragraph — Now clearly scoped to projects using a SDK other than Microsoft.NET.Sdk. Removed the "We strongly recommend" phrasing per style guide.

Internal previews

📄 File 🔗 Preview link
docs/core/testing/unit-testing-mstest-running-tests.md Run tests with MSTest

Copilot AI requested review from Copilot and removed request for Copilot June 26, 2026 22:42
Copilot AI requested review from Copilot and removed request for Copilot June 26, 2026 22:44
Copilot AI requested review from Copilot and removed request for Copilot June 26, 2026 22:45
Copilot AI changed the title [WIP] Add example for integration tests with MSTest SDK Clarify MSTest.Sdk incompatibility with ASP.NET Core (Microsoft.NET.Sdk.Web) Jun 26, 2026
Copilot AI requested a review from adegeo June 26, 2026 22:46

Alternatively, you can enable MSTest runner by adding the `EnableMSTestRunner` property and setting `OutputType` to `Exe` in your project file. You also need to ensure that you're using `MSTest 3.2.0` or newer. We strongly recommend you update to the latest MSTest version available.
> [!NOTE]
> Because `MSTest.Sdk` replaces `Microsoft.NET.Sdk`, it isn't compatible with projects that require a different project SDK. For example, ASP.NET Core integration test projects that require `Microsoft.NET.Sdk.Web` can't use `MSTest.Sdk`.

@Youssef1313 Youssef1313 Jun 27, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we tried one of the following?

<Project Sdk="Microsoft.NET.Sdk.Web">
  <Import Project="Sdk.props" Sdk="MSTest.Sdk" />

  // ...

  <Import Project="Sdk.targets" Sdk="MSTest.Sdk" />
</Project>

or

<Project Sdk="MSTest.Sdk">
  <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk.Web" />

  // ...

  <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.Web" />
</Project>

to see if that works? And if it does work, do we want to make that recommendation?

And if it doesn't work, is there anything that MSTest.Sdk could adjust to make that work?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Youssef1313 :)

I'm really trying to just correct the issue at hand which is there is some ambiguity as to when you can actually take the prescribed course of replacing the SDK entry. If you can test and suggest a different suggestion in the article, that would be great! I did just reedit the Copilot suggestions and I think it's clearer this time. So please re-review.

Clarify compatibility of MSTest.Sdk with project SDKs and provide instructions for manual configuration.
Copilot AI review requested due to automatic review settings July 1, 2026 21:53
@adegeo adegeo marked this pull request as ready for review July 1, 2026 21:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR clarifies how to enable Microsoft.Testing.Platform (MTP) in MSTest projects by explaining that MSTest.Sdk replaces the project SDK, which makes it unsuitable for projects that must use a different top-level SDK (for example, Microsoft.NET.Sdk.Web for ASP.NET Core integration tests). It also tightens guidance on when to use the manual configuration approach.

Changes:

  • Rewrites the “Enable MTP in an MSTest project” intro to be more direct and explicit about MSTest.Sdk replacing the project SDK.
  • Adds a NOTE callout explaining why MSTest.Sdk shouldn’t be used when a project needs a different SDK (example: ASP.NET Core).
  • Rewrites the “Alternatively” guidance to scope it to non-Microsoft.NET.Sdk projects and explain the manual setup path.

Comment thread docs/core/testing/unit-testing-mstest-running-tests.md
Comment thread docs/core/testing/unit-testing-mstest-running-tests.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@adegeo adegeo enabled auto-merge (squash) July 1, 2026 22:33
@adegeo adegeo disabled auto-merge July 1, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants