Clarify MSTest.Sdk incompatibility with ASP.NET Core (Microsoft.NET.Sdk.Web)#54554
Clarify MSTest.Sdk incompatibility with ASP.NET Core (Microsoft.NET.Sdk.Web)#54554Copilot wants to merge 5 commits into
Conversation
|
|
||
| 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`. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.Sdkreplacing the project SDK. - Adds a NOTE callout explaining why
MSTest.Sdkshouldn’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.Sdkprojects and explain the manual setup path.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The "Enable MTP in an MSTest project" section didn't explain that
MSTest.SdkreplacesMicrosoft.NET.Sdkas the project SDK—making it incompatible with ASP.NET Core integration test projects that requireMicrosoft.NET.Sdk.Web. The "alternatively" paragraph also didn't make clear when to use manual configuration over the SDK approach.Changes
MSTest.SdkreplacesMicrosoft.NET.Sdkas the project SDK with MTP enabled by default.MSTest.Sdkisn't compatible with projects requiring a different SDK, withMicrosoft.NET.Sdk.Web(ASP.NET Core) as the concrete example.Microsoft.NET.Sdk. Removed the "We strongly recommend" phrasing per style guide.Internal previews