migrate-vstest-to-mtp
하는 일
이 스킬은 오래된 VSTest 실행기에서 새 테스트 플랫폼인 Microsoft.Testing.Platform으로 .NET 테스트 프로젝트를 옮깁니다. 실행기를 바꾸고 테스트 명령과 CI 파이프라인도 업데이트하려는 팀을 위한 스킬입니다.
사용하는 경우
- ✓.NET 테스트 솔루션을 VSTest에서 Microsoft.Testing.Platform으로 바꾸고 싶을 때.
- ✓테스트를 직접 실행 파일로 돌리거나 dotnet run, dotnet watch와 함께 써야 할 때.
- ✓전환 후 테스트 실행 방식이 달라져서 CI 파이프라인을 고쳐야 할 때.
스킬 링크
https://github.com/dotnet/skills/blob/main/plugins/dotnet-test-migration/skills/migrate-vstest-to-mtp/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 .NET 테스트 프로젝트를 VSTest에서 Microsoft.Testing.Platform으로 옮기고, CI 파이프라인도 업데이트해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트가 프레임워크와 SDK 버전을 확인하고, 맞는 설정과 명령 문법을 적용하며, 새 플랫폼에서 테스트가 실행되도록 파이프라인 단계를 업데이트합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
VSTest -> Microsoft.Testing.Platform Migration
Migrate a .NET test solution from VSTest to Microsoft.Testing.Platform (MTP). The outcome is a solution where all test projects run on MTP, dotnet test works correctly, and CI/CD pipelines are updated.
First Action
Inspect the supplied project, Directory.Build.props, global.json, and CI
files before searching the web or answering from memory. Resolve the framework
and SDK mode first: .NET 9 and earlier use the compatibility property plus the
-- separator; .NET 10 native MTP uses global.json, removes that property,
and passes MTP arguments without the separator. For central properties, never
condition on IsTestProject in Directory.Build.props; use a property already
available there, such as MSBuildProjectName.
Important: Do not mix VSTest-based and MTP-based .NET test projects in the same solution or run configuration -- this is an unsupported scenario.
When to Use
- Switching from VSTest to Microsoft.Testing.Platform for any supported test framework
- Enabling
dotnet run/dotnet watch/ direct executable execution for test projects - Enabling Native AOT or trimmed test execution
- Replacing
vstest.console.exewithdotnet teston MTP - Updating CI/CD pipelines from the VSTest task to the .NET Core CLI task
- Updating
dotnet testarguments from VSTest syntax to MTP syntax
When Not to Use
- The project already runs on Microsoft.Testing.Platform and there is no remaining MTP behavioral difference to resolve (e.g., exit code 8 for zero tests discovered)
- Migrating between test frameworks (e.g., MSTest to xUnit.net) -- different effort entirely
- The project builds UWP or packaged WinUI test projects -- MTP does not support these yet
- The solution mixes .NET and non-.NET test adapters (e.g., JavaScript or C++ adapters) -- VSTest is required
- Upgrading MSTest versions -- use
migrate-mstest-v1v2-to-v3ormigrate-mstest-v3-to-v4
Inputs
| Input | Required | Description |
|---|---|---|
| Project or solution path | No | The .csproj, .sln, or .slnx entry point containing test projects. Discover it yourself by globbing the working directory; ask only when nothing is found or the choice is genuinely ambiguous |
| Test framework | No | MSTest, NUnit, xUnit.net v2, or xUnit.net v3. Auto-detected from package references |
| .NET SDK version | No | Determines dotnet test integration mode. Prefer the repository's global.json or explicitly stated CI SDK; use host dotnet --version only when the repository does not pin or state one |
| CI/CD pipeline files | No | Paths to pipeline definitions that invoke vstest.console or dotnet test |
Execution and Answer Contract
- Discover project, props,
global.json, and pipeline files in the current working directory. Open literal search results; the skill directory is not the user's repository. Continue after skill activation and do not ask for a discoverable path. - For an implementation request, edit the files, then validate the effective MSBuild properties, the translated command, test counts, and requested artifacts. For a question, provide one exact command/configuration for the detected SDK and framework rather than a menu of near-equivalents.
- Preserve all build arguments and avoid introducing
--no-build, new settings files, or unrelated package upgrades. Never retain--settings <file>unless that file exists. - For .NET 9 and earlier, show the
--separator. For .NET 10 native MTP mode, explicitly say to remove it. - When suppressing exit code 8 is intentional, warn that broad suppression can hide an accidental empty run caused by a bad filter; scope it to the known zero-test project/configuration.
- For an exit-code-8 question, show all three concrete forms:
--ignore-exit-code 8,TestingPlatformCommandLineArguments, andTESTINGPLATFORM_EXITCODE_IGNORE=8. - For xUnit v3 filters, give the directly usable
--filter-class/--filter-method/--filter-traitcommand and explain AND behavior. When the resolved xUnit version supports it, include--filter-querypath syntax for complex expressions and link the xUnit query-filter documentation. - When translating reporters, coverage, or dumps, name each required package in the answer; a correct-looking option without its owning extension package is incomplete.
- Final results must name the framework runner opt-in, repository-selected SDK integration mode, exact translated command,
자주 묻는 질문
VSTest와 MTP 프로젝트를 한 솔루션에 함께 둘 수 있나요?
아니요. 같은 솔루션이나 실행 구성에서 둘을 섞는 것은 지원되지 않는다고 스킬이 설명합니다.
명령 문법도 바뀌나요?
네. VSTest 인수를 새 플랫폼이 쓰는 문법으로 바꿉니다.
Native AOT도 다루나요?
네. Native AOT나 트리밍된 테스트 실행을 켜는 것을 다룹니다.
상세 정보
작성자의 원본 설명
Use this skill before answering, planning, or editing whenever .NET tests or CI are switching from VSTest to Microsoft.Testing.Platform (MTP), or an MTP migration behaves differently. Triggers include "switch from VSTest"; MSTest/NUnit/xUnit MTP enablement; OutputType=Exe only for test projects in Directory.Build.props; EnableMSTestRunner, EnableNUnitRunner, UseMicrosoftTestingPlatformRunner, or YTest.MTP.XUnit2; .NET 10 global.json test.runner and TestingPlatformDotnetTestSupport; translating VSTest filters, logger, coverage, blame, or dump arguments; replacing VSTest@3; and exit code 8 or ze
repo: dotnet/skills
인기도
- GitHub 스타
- 5.8k
- 순위
- #14620
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
create-custom-agent
5.8k에이전트가 자체 도구, 지침, 다른 에이전트로의 핸드오프를 가진 VS Code 커스텀 에이전트 파일을 만들도록 돕습니다.
create-skill
5.8k에이전트가 올바른 이름, 명확한 트리거 설명, 표준을 따르는 SKILL.md 파일로 새 에이전트 스킬을 만들도록 돕습니다.
csharp-scripts
5.8k에이전트가 .NET 명령줄 도구로 작은 C# 프로그램을 전체 프로젝트 없이 단일 파일로 실행하도록 돕습니다.
dotnet-pinvoke
5.8k에이전트가 .NET에서 네이티브 C나 C++ 라이브러리를 올바르게 호출하도록 돕습니다. 시그니처, 문자열 처리, 메모리, 안전 핸들을 다룹니다.
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.