You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/core/testing/unit-testing-mstest-migration-from-v1-to-v3.md
+13-10Lines changed: 13 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: MSTest migration to v3
3
3
description: Learn about migrating from legacy MSTest (MSTest v1) to latest MSTest (MSTest v3).
4
4
author: engyebrahim
5
5
ms.author: enjieid
6
-
ms.date: 11/06/2024
6
+
ms.date: 11/28/2025
7
7
---
8
8
9
9
# MSTest v3 migration guide
@@ -21,9 +21,9 @@ If your project relies on MSTest for unit testing and includes the above referen
21
21
22
22
### Why migrate to MSTest v3?
23
23
24
-
Even if you’re satisfied with your current MSTest setup, upgrading to MSTest v3 unlocks substantial advantages that improve both the quality and future-readiness of your tests. Here’s why making the switch now can be a valuable step forward:
24
+
Even if you're satisfied with your current MSTest setup, upgrading to MSTest v3 unlocks substantial advantages that improve both the quality and future-readiness of your tests. Here's why making the switch now can be a valuable step forward:
25
25
26
-
-**Enhanced security**: MSTest v1 has known security vulnerabilities. With MSTest v3, we’ve implemented extensive security improvements to safeguard your testing environment.
26
+
-**Enhanced security**: MSTest v1 has known security vulnerabilities. With MSTest v3, we've implemented extensive security improvements to safeguard your testing environment.
27
27
-**Immediate Performance Boosts**: MSTest v3 significantly reduces test execution time and optimizes resource usage. This is particularly beneficial in CI/CD pipelines, where faster tests can shorten deployment cycles and cut infrastructure costs.
28
28
29
29
-**Future-Proofing Your Tests**: MSTest v3 offers robust support for modern .NET versions, including .NET 8, and future iterations, along with cross-platform compatibility. This means your tests will be more adaptable and ready for upgrades, avoiding the technical debt of outdated testing frameworks.
@@ -36,7 +36,10 @@ Even if you’re satisfied with your current MSTest setup, upgrading to MSTest v
36
36
37
37
-**Greater Flexibility and Extensibility**: MSTest v3 supports advanced testing scenarios, including dynamic data sources and in-assembly parallel execution. This flexibility enables more sophisticated testing approaches and speeds up test suites without complex configurations.
38
38
39
-
By upgrading, you’re setting up your tests to be faster, more reliable, and adaptable to future .NET developments, positioning your project for long-term success and easier maintenance.
39
+
By upgrading, you're setting up your tests to be faster, more reliable, and adaptable to future .NET developments, positioning your project for long-term success and easier maintenance.
40
+
41
+
> [!TIP]
42
+
> After migrating to MSTest v3, consider taking a further step and migrate to MSTest v4. For more information, see [Migrate from MSTest v3 to v4](./unit-testing-mstest-migration-v3-v4.md).
40
43
41
44
## Migration steps
42
45
@@ -54,7 +57,7 @@ In non-SDK style projects, these references are often added through Visual Studi
54
57
4. Inside the **References** folder, **find and select** the MSTest DLL references, `Microsoft.VisualStudio.QualityTools.UnitTestFramework`
55
58
5.**Right-click** the selected reference(s) and choose **Remove** from the context menu.

58
61
59
62
6.**Save the project** to apply changes.
60
63
@@ -65,20 +68,20 @@ You can update your project to MSTest v3 in one of two ways:
65
68
-**Update Packages**: If you have NuGet package references to the [MSTest.TestFramework](https://www.nuget.org/packages/MSTest.TestFramework) and the [MSTest.TestAdapter](https://www.nuget.org/packages/MSTest.TestAdapter/), update them using the NuGet Package Manager in Visual Studio or by running the following command in the NuGet Package Manager Console:
- **Or Install MSTest Package**: Install the latest [MSTest](https://www.nuget.org/packages/MSTest) package using the NuGet Package Manager in Visual Studio or by running the following commandin the NuGet Package Manager Console:
73
76
74
77
```shell
75
-
Install-Package MSTest -Version 3.6.2
78
+
Install-Package MSTest -Version 3.11.1
76
79
```
77
80
78
81
- **Or update the project file directly** (for SDK-style projects): Update your `.csproj` file to specify the MSTest SDK version.
79
82
80
83
```xml
81
-
<Project Sdk="MSTest.Sdk/3.6.2">
84
+
<Project Sdk="MSTest.Sdk/3.11.1">
82
85
<PropertyGroup>
83
86
<TargetFramework>net8.0</TargetFramework>
84
87
</PropertyGroup>
@@ -140,7 +143,7 @@ The DataRowAttribute constructors in MSTest v3 have been simplified to enforce t
140
143
public void MyTestMethod(int number, string text) { ... }
141
144
```
142
145
143
-
In cases where types don’t match exactly, MSTest v3 will now raise an error rather than attempting a conversion.
146
+
In cases where types don't match exactly, MSTest v3 will now raise an error rather than attempting a conversion.
0 commit comments