migrate-mstest-v1v2-to-v3
Migrate MSTest v1/v2 projects to MSTest v3, and fix v1/v2-to-v3 breaking changes that surface after the packages are already at 3.x. USE FOR: removing v1 Microsoft.VisualStudio.QualityTools.UnitTestFramework assembly references; moving MSTest.TestFramework/TestAdapter 1.x-2.x to 3.x, the MSTest metapackage, or MSTest.Sdk; tests that broke after a 2.x-to-3.x bump -- CS0411/CS1503 on Assert.AreEqual/AreNotEqual/AreSame once the object overloads became generic, and DataRow strict type matching (1L vs 1) that builds with MSTEST0014 but fails at run time; .testsettings/LegacySettings to .runsetting
npx skills add dotnet/skills --skill migrate-mstest-v1v2-to-v3 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Guides and executes migration of MSTest v1/v2 projects to MSTest v3, addressing breaking changes that surface after upgrading packages. It covers removing v1 assembly references, updating to MSTest v3 (including MSTest metapackage or MSTest.Sdk options), preserving or updating the test runner, and adapting to Breaking Changes Summary (notably assertion overloads, DataRow typing, and .testsettings to .runsettings). It includes steps to verify package versions, adjust target frameworks, and fix only the applicable breaking changes present in the project. It emphasizes assessing current MSTest version, preserving test platforms, and performing full migrations when requested. It provides concrete fix guidance for assertion overloads and DataRow literal typing, and warns to delete legacy settings files when required.
How it works
- Assess the project to determine whether MSTest v1 via assembly reference or MSTest v1/v2 via NuGet 1.x/2.x is in use.
- If MSTest v1 assembly reference is present, remove the Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll reference from the .csproj (SDK-style) or via Visual Studio references, then save.
- Update packages to MSTest v3 by replacing individual MSTest.* references with the MSTest metapackage (Include="MSTest" Version="3.8.0"). Ensure Microsoft.NET.Test.Sdk is updated to a compatible version (e.g., 17.13.0 or later) unless centrally managed. If using MSTest.Sdk, adjust the project to MSTest.Sdk/3.8.0 and remove obsolete MSTest-related packages and properties as indicated.
- Update target frameworks as needed to supported TFMs (e.g., net6.0+/net8.0, netstandard2.0, etc.) per the Breaking Changes Summary.
- Resolve build errors by applying only the relevant changes listed in the Breaking Changes Summary: fix Assert.AreEqual/AreNotEqual/AreSame calls by adding explicit type arguments when inference fails; fix DataRow literal types to exact parameter types (e.g., 1 vs 1L); and delete .testsettings in favor of .runsettings with equivalent configuration. Do not modify beyond the discovered issues.
- Run the existing test command and verify results, updating as needed based on the project’s evidence.
When to use it
- When the project references Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll (MSTest v1) or uses MSTest.TestFramework/TestAdapter NuGet 1.x/2.x and needs migration to MSTest v3.
- When resolving build errors after updating MSTest packages to v3, including scenarios where packages show 3.x but legacy settings or code still require fixes.
- When converting .testsettings to .runsettings and adopting MSTest.Sdk vs MSTest metapackage.
What it can touch
- Project file edits to remove v1 assembly references or adjust PackageReference blocks.
- NuGet package references: MSTest, MSTest.TestFramework, MSTest.TestAdapter, MSTest.Sdk, Microsoft.NET.Test.Sdk, and related configuration properties.
- Source files that contain breaking-change usage such as Assert.AreEqual/AreNotEqual/AreSame calls and DataRow literals.
- Configuration files: .testsettings (to be replaced by .runsettings) and related deployment/configuration settings.
- Target framework declarations in the project as needed to align with MSTest v3 support.
Caveats
- MSTest v3 is not binary compatible with v1/v2; libraries must be recompiled against v3.
- If a project already uses MSTest v3 with no leftover v1/v2 items, this skill reports migration as complete and makes no changes.
- The tool requires evidence from the project to decide which path to take (assembly reference vs NuGet) and does not proceed with speculative edits.
- The summary emphasizes concrete fixes only for issues observed in the project (e.g., type-argument fixes for Assert.AreEqual, DataRow type matching), and avoids broad, unconditional changes.
# MSTest v1/v2 -> v3 Migration Migrate a test project from MSTest v1 (assembly references) or MSTest v2 (NuGet 1.x-2.x) to MSTest v3. MSTest v3 is **not binary compatible** with v1/v2 -- libraries compiled against v1/v2 must be recompiled. ## When to Use - Project references `Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll` (MSTest v1) - Project uses `MSTest.TestFramework` / `MSTest.TestAdapter` NuGet 1.x or 2.x - Resolving build errors after updating MSTest packages from v1/v2 to v3 -- including when the packages already read 3.x and only the source or settings still need fixing - Replacing `.testsettings` with `.runsettings` - Adopting MSTest.Sdk or in-assembly parallel execution ## When Not to Use - Project already on MSTest v3 with no migration-related build errors and no leftover `.testsettings` / `<LegacySettings>` (fully migrated) - Upgrading v3 to v4 -- use `migrate-mstest-v3-to-v4` - Migrating between frameworks (MSTest to xUnit/NUnit) ## Boundary Gate Check package versions before any edit. If all MSTest references are already 3.x, no v1/v2-to-v3 error is reported, and no `.testsettings` or `<LegacySettings>` remains, state that migration is complete and make no
- When to Use
- When Not to Use
- Boundary Gate
- Inputs
- Breaking Changes Summary
- Response Guidelines
- Migration Paths
- Workflow
- Step 1: Assess the project
- Step 2: Remove v1 assembly references (if applicable)
- Step 3: Update packages to MSTest v3
- Step 4: Update target frameworks if needed
- Step 5: Resolve build errors and breaking changes
- Step 6: Replace .testsettings with .runsettings
What does the migrate-mstest-v1v2-to-v3 skill do?
Migrate MSTest v1/v2 projects to MSTest v3, and fix v1/v2-to-v3 breaking changes that surface after the packages are already at 3.x. USE FOR: removing v1 Microsoft.VisualStudio.QualityTools.UnitTestFramework assembly references; moving MSTest.TestFramework/TestAdapter 1.x-2.x to 3.x, the MSTest metapackage, or MSTest.Sdk; tests that broke after a 2.x-to-3.x bump -- CS0411/CS1503 on Assert.AreEqual/AreNotEqual/AreSame once the object overloads became generic, and DataRow strict type matching (1L vs 1) that builds with MSTEST0014 but fails at run time; .testsettings/LegacySettings to .runsetting
How do I install it?
Run `npx skills add dotnet/skills --skill migrate-mstest-v1v2-to-v3 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From dotnet/skills, a repository with 4,927 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.