Skip to content

Commit 224280a

Browse files
Youssef1313Copilot
andauthored
Update MSTest v1 to v3 migration guide (#50206)
* Update MSTest v1 to v3 migration guide * Update docs/core/testing/unit-testing-mstest-migration-from-v1-to-v3.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent ddf3ea4 commit 224280a

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

docs/core/testing/unit-testing-mstest-migration-from-v1-to-v3.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: MSTest migration to v3
33
description: Learn about migrating from legacy MSTest (MSTest v1) to latest MSTest (MSTest v3).
44
author: engyebrahim
55
ms.author: enjieid
6-
ms.date: 11/06/2024
6+
ms.date: 11/28/2025
77
---
88

99
# MSTest v3 migration guide
@@ -21,9 +21,9 @@ If your project relies on MSTest for unit testing and includes the above referen
2121

2222
### Why migrate to MSTest v3?
2323

24-
Even if youre satisfied with your current MSTest setup, upgrading to MSTest v3 unlocks substantial advantages that improve both the quality and future-readiness of your tests. Heres 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:
2525

26-
- **Enhanced security**: MSTest v1 has known security vulnerabilities. With MSTest v3, weve 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.
2727
- **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.
2828

2929
- **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
3636

3737
- **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.
3838

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).
4043
4144
## Migration steps
4245

@@ -54,7 +57,7 @@ In non-SDK style projects, these references are often added through Visual Studi
5457
4. Inside the **References** folder, **find and select** the MSTest DLL references, `Microsoft.VisualStudio.QualityTools.UnitTestFramework`
5558
5. **Right-click** the selected reference(s) and choose **Remove** from the context menu.
5659

57-
![image](https://github.com/user-attachments/assets/7aff1afb-e26b-4450-bc2e-903a577e3df2)
60+
![Context menu of the assembly reference](https://github.com/user-attachments/assets/7aff1afb-e26b-4450-bc2e-903a577e3df2)
5861

5962
6. **Save the project** to apply changes.
6063

@@ -65,20 +68,20 @@ You can update your project to MSTest v3 in one of two ways:
6568
- **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:
6669

6770
```shell
68-
Update-Package MSTest.TestFramework -Version 3.6.2
69-
Update-Package MSTest.TestAdapter -Version 3.6.2
71+
Update-Package MSTest.TestFramework -Version 3.11.1
72+
Update-Package MSTest.TestAdapter -Version 3.11.1
7073
```
7174

7275
- **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 command in the NuGet Package Manager Console:
7376

7477
```shell
75-
Install-Package MSTest -Version 3.6.2
78+
Install-Package MSTest -Version 3.11.1
7679
```
7780

7881
- **Or update the project file directly** (for SDK-style projects): Update your `.csproj` file to specify the MSTest SDK version.
7982

8083
```xml
81-
<Project Sdk="MSTest.Sdk/3.6.2">
84+
<Project Sdk="MSTest.Sdk/3.11.1">
8285
<PropertyGroup>
8386
<TargetFramework>net8.0</TargetFramework>
8487
</PropertyGroup>
@@ -140,7 +143,7 @@ The DataRowAttribute constructors in MSTest v3 have been simplified to enforce t
140143
public void MyTestMethod(int number, string text) { ... }
141144
```
142145
143-
In cases where types dont 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.
144147
145148
### Timeout settings
146149

0 commit comments

Comments
 (0)