From 3857ca2effce3019efb6aa46cc4d00414ebd8bb9 Mon Sep 17 00:00:00 2001 From: Youssef Victor Date: Fri, 17 Oct 2025 22:03:32 +0200 Subject: [PATCH 1/2] Update MSTest v4 migration notes for MSTest.Sdk break around VSTest Clarify changes in MSTest v4 regarding default settings and package references. --- docs/core/testing/unit-testing-mstest-migration-v3-v4.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/core/testing/unit-testing-mstest-migration-v3-v4.md b/docs/core/testing/unit-testing-mstest-migration-v3-v4.md index 145add5d519f5..f25959cbcad90 100644 --- a/docs/core/testing/unit-testing-mstest-migration-v3-v4.md +++ b/docs/core/testing/unit-testing-mstest-migration-v3-v4.md @@ -213,3 +213,9 @@ To address long outstanding bugs that many users filed, the generation of `TestC ### TreatDiscoveryWarningsAsErrors now defaults to true v4 uses stricter defaults. As such, the default value of `TreatDiscoveryWarningsAsErrors` is now `true`. This should be a transparent change for most users and should help other users to uncover hidden bugs. + +### MSTest.Sdk no longer adds `Microsoft.NET.Test.Sdk` reference when using Microsoft.Testing.Platform + +MSTest.Sdk, by default, uses Microsoft.Testing.Platform, unless `UseVSTest` MSBuild property is set to true. In MSTest 3.x, the SDK still adds reference to Microsoft.NET.Test.Sdk (which brings VSTest support) even when using Microsoft.Testing.Platform. This package reference is unneeded when running with Microsoft.Testing.Platform, and thus is removed in MSTest v4. + +If you still want to have VSTest supported (for example, if you want to run with vstest.console), you need to manually add a package reference to `Microsoft.NET.Test.Sdk` NuGet package to your project. From 3d8834d779b037fb47db5496bc96891141bfe00a Mon Sep 17 00:00:00 2001 From: Youssef Victor Date: Fri, 17 Oct 2025 22:08:13 +0200 Subject: [PATCH 2/2] Update docs/core/testing/unit-testing-mstest-migration-v3-v4.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/core/testing/unit-testing-mstest-migration-v3-v4.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/testing/unit-testing-mstest-migration-v3-v4.md b/docs/core/testing/unit-testing-mstest-migration-v3-v4.md index f25959cbcad90..bfbf4f93558c4 100644 --- a/docs/core/testing/unit-testing-mstest-migration-v3-v4.md +++ b/docs/core/testing/unit-testing-mstest-migration-v3-v4.md @@ -216,6 +216,6 @@ v4 uses stricter defaults. As such, the default value of `TreatDiscoveryWarnings ### MSTest.Sdk no longer adds `Microsoft.NET.Test.Sdk` reference when using Microsoft.Testing.Platform -MSTest.Sdk, by default, uses Microsoft.Testing.Platform, unless `UseVSTest` MSBuild property is set to true. In MSTest 3.x, the SDK still adds reference to Microsoft.NET.Test.Sdk (which brings VSTest support) even when using Microsoft.Testing.Platform. This package reference is unneeded when running with Microsoft.Testing.Platform, and thus is removed in MSTest v4. +By default, MSTest.Sdk uses Microsoft.Testing.Platform. If the `UseVSTest` MSBuild property is set to true, it will use VSTest instead. In MSTest 3.x, the SDK added a reference to Microsoft.NET.Test.Sdk (which brings VSTest support) even when using Microsoft.Testing.Platform. This package reference is unnecessary when running with Microsoft.Testing.Platform and has been removed in MSTest v4. If you still want to have VSTest supported (for example, if you want to run with vstest.console), you need to manually add a package reference to `Microsoft.NET.Test.Sdk` NuGet package to your project.