microsoft/vstest/vstest-build-test
Claude Code and agent skill by microsoft/vstest
- vendor
Checking that the SKILL.md file is still in the repository.
Build, test, and validate changes in the vstest repository. Use when building vstest projects, running unit tests, smoke tests, or acceptance tests, or when deploying locally built vstest.console for manual testing.
Install
npx vskill@latest install microsoft/vstest/vstest-build-testSKILL.md
The same SKILL.md was published earlier as microsoft/vstest/vstest-build-test.
Building and Testing vstest
Pre-Build: Environment Setup
Before building, verify the .dotnet toolchain matches the current OS. The repo bootstraps its own .NET SDK into .dotnet/.
Detect OS vs .dotnet Mismatch
Run this check before every first build in a session:
After cleanup (or if .dotnet doesn't exist), the build script automatically downloads the correct SDK version from global.json.
Build
Platform Commands
| Action | Windows | Linux / macOS | |
|---|---|---|---|
| Restore + Build | ./build.cmd | ./build.sh | |
| Restore only | ./restore.cmd | ./restore.sh | |
| Build + Pack | ./build.cmd -pack | ./build.sh --pack | |
| Release config | ./build.cmd -c Release -pack | ./build.sh -c Release --pack | |
| Single project | ./build.cmd -project <csproj> | ./build.sh --projects <csproj> |
Full Build (Recommended)
For projects with many cross-project dependencies (e.g., HtmlLogger, TrxLogger, vstest.console):
This produces NuGet packages under artifacts/packages/Debug/Shipping/.
Single Project Build
For isolated projects with few dependencies:
Warning: This does NOT work for projects like HtmlLogger that have many transitive dependencies. Use--pack/-packinstead.
Test
Unit Tests (Default)
Specific Project(s)
-projects / --projects takes a resolvable path or glob — it is passed through Resolve-Path, so a bare project nickname or category (e.g. smoke, htmllogger) fails with Cannot find path. Point it at the csproj(s):
For a single project you can also build+test its csproj directly with the bootstrapped SDK:
Test Categories (smoke / integration / performance / compatibility)
These are switches handled by eng/build.ps1 — NOT -projects values:
-smokeTestand-integrationTestare mutually exclusive (smoke is a subset); passing both throws.
Filter by Test Name
On Windows use the -filter parameter. Do not pass --filter inside TestRunnerAdditionalArguments — eng/build.ps1 explicitly throws if you do.
On Linux/macOS test.sh has no -filter parameter, so the filter goes in as an MSBuild property. The single quotes are required, otherwise bash interprets &, |, and the inner quotes.
See CONTRIBUTING.md for more filtering examples.
Running tests locally (DOTNET_ROOT gotcha)
Test executables are built against the repo's preview TFM (e.g. net12.0), and integration and smoke tests additionally launch test-asset apphosts built the same way. An apphost resolves its shared runtime from DOTNET_ROOT, falling back to the machine-wide install (C:\Program Files\dotnet), which usually lacks the preview runtime — so it fails instantly with "You must install or update .NET to run this application." This hits plain unit test runs too, not only integration and smoke tests.
test.sh(Linux/macOS) setsDOTNET_ROOTto the repo.dotnetautomatically.test.cmd(Windows) does not — set it yourself before running:
Manual Validation with vstest.console
After building with --pack / -pack, validate vstest.console changes by unzipping the built package:
- Locate the package:
artifacts/packages/Debug/Shipping/Microsoft.TestPlatform.<version>-dev.nupkg - Unzip it (
.nupkgfiles are ZIP archives) - Run the local vstest.console against a test project
Alternative: Direct Artifact Paths
- xplat (netcoreapp):
artifacts/<Configuration>/netcoreapp1.0/vstest.console.dll - Windows desktop:
artifacts/<Configuration>/net46/win7-x64/vstest.console.exe
Test Categories
| Category | Speed | What it tests | How to run | |
|---|---|---|---|---|
| Unit tests | Fast | Individual units | ./test.cmd / ./test.sh (default) | |
| Smoke tests | Slow | P0 end-to-end scenarios | -smokeTest switch | |
| Acceptance / integration | Slowest | Extensive coverage | -integrationTest switch |
Troubleshooting
- OS mismatch errors: If you see SDK load failures, run the mismatch detection script above to clean and re-bootstrap.
- `Toolset version <version> has not been restored.`:
test.cmd/test.shdo not restore. Build once (./build.cmd -c Release) first, or pass-restore -buildto the test command. - Tests fail instantly on Windows with "You must install or update .NET to run this application":
test.cmddoes not setDOTNET_ROOT, so the preview-TFM apphosts look inC:\Program Files\dotnet(which lacks the preview runtime). Set$env:DOTNET_ROOT = "$PWD\.dotnet"before running — see "Running tests locally". - If build fails asking for .NET 4.6 targeting pack, install it from Microsoft Downloads
- Enable verbose diagnostics: see
docs/diagnose.md - For debugging, add
Debugger.Launchat process entry points (testhost.exe, vstest.console.exe)
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 1 Oct 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/vstest-build-test/SKILL.md
Popularity
- Repository stars
- 966
- Repository forks
- 358
- 7-day trend score
- 34
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/vstest/vstest-build-test)