
Build And Test
- 41 installs
- 12.4k repo stars
- Updated July 27, 2026
- microsoft/agent-framework
build-and-test is an agent skill for building and testing .NET Agent Framework projects with MTP, filter-query, and scoped project commands.
About
The build-and-test skill documents how to build and test .NET projects in the Microsoft Agent Framework repository. Only UnitTest projects run locally because IntegrationTests require external dependencies. Commands from the dotnet directory include dotnet restore, build with --tl:off to avoid agent flicker, dotnet test, and dotnet format. Isolated changes should build only the affected project and its UnitTests before full solution validation, while public API changes require immediate full solution build and all unit tests. Single test execution uses filter-query with assembly namespace class method wildcards and --ignore-exit-code 8 when MTP reports no matching tests. Multi-target framework tip passes -f net10.0 when code lacks framework-specific if directives. Package restore tip adds --no-restore after initial restore for faster builds. Linux runs only .NET Core tests via net10.0 framework filter. Microsoft Testing Platform via xUnit v3 requires --project on dotnet test, supports coverage with cobertura output, and filtered solutions via New-FilteredSolution.ps1. Use when verifying or testing Agent Framework changes.
- Documents dotnet restore build test format from dotnet directory with --tl:off.
- Isolated versus public API change build scope guidance.
- Microsoft Testing Platform xUnit v3 filter-query and exit code 8 handling.
- Multi-target -f net10.0 speed tip and --no-restore optimization.
- Filtered solution script for TFM-specific test runs across large solution.
Build And Test by the numbers
- 41 all-time installs (skills.sh)
- Ranked #1,282 of 2,184 Testing & QA skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
build-and-test capabilities & compatibility
- Capabilities
- scoped versus full solution build guidance · mtp dotnet test with filter query patterns · multi target framework speed optimizations · linux net10.0 test filtering · filtered solution generation for large test runs
- Use cases
- testing · ci cd
What build-and-test says it does
How to build and test .NET projects in the Agent Framework repository.
npx skills add https://github.com/microsoft/agent-framework --skill build-and-testAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 41 |
|---|---|
| repo stars | ★ 12.4k |
| Security audit | 3 / 3 scanners passed |
| Last updated | July 27, 2026 |
| Repository | microsoft/agent-framework ↗ |
How do I build and run tests for Microsoft Agent Framework .NET changes efficiently?
Build and test .NET projects in the Microsoft Agent Framework repository with MTP and targeted project commands.
Who is it for?
Contributors to microsoft/agent-framework who need dotnet build and test conventions.
Skip if: Skip for Python development, integration tests requiring external services, or non-Agent Framework repos.
When should I use this skill?
User verifies or tests Agent Framework .NET changes, runs unit tests, or needs MTP filter-query syntax.
What you get
Validated builds and unit test results using scoped or full solution MTP test commands.
Files
- Only UnitTest projects need to be run locally; IntegrationTests require external dependencies.
- See
../project-structure/SKILL.mdfor project structure details.
Build, Test, and Lint Commands
# From dotnet/ directory
dotnet restore --tl:off # Restore dependencies for all projects
dotnet build --tl:off # Build all projects
dotnet test # Run all tests
dotnet format # Auto-fix formatting for all projects
# Build/test/format a specific project (preferred for isolated/internal changes)
dotnet build src/Microsoft.Agents.AI.<Package> --tl:off
dotnet test --project tests/Microsoft.Agents.AI.<Package>.UnitTests
dotnet format src/Microsoft.Agents.AI.<Package>
# Run a single test
# Replace the filter values with the appropriate assembly, namespace, class, and method names for the test you want to run and use * as a wildcard elsewhere, e.g. "/*/*/HttpClientTests/GetAsync_ReturnsSuccessStatusCode"
# Use `--ignore-exit-code 8` to avoid failing the build when no tests are found for some projects
dotnet test --filter-query "/<assemblyFilter>/<namespaceFilter>/<classFilter>/<methodFilter>" --ignore-exit-code 8
# Run unit tests only
# Use `--ignore-exit-code 8` to avoid failing the build when no tests are found for integration test projects
dotnet test --filter-query "/*UnitTests*/*/*/*" --ignore-exit-code 8Use --tl:off when building to avoid flickering when running commands in the agent.
Speeding Up Builds and Testing
The full solution is large. Use these shortcuts:
| Change type | What to do |
|---|---|
| Isolated/Internal logic | Build only the affected project and its *.UnitTests project. Fix issues, then build the full solution and run all unit tests. |
| Public API surface | Build the full solution and run all unit tests immediately. |
Example: Building a single code project for all target frameworks
# From dotnet/ directory
dotnet build ./src/Microsoft.Agents.AI.AbstractionsExample: Building a single code project for just .NET 10.
# From dotnet/ directory
dotnet build ./src/Microsoft.Agents.AI.Abstractions -f net10.0Example: Running tests for a single project using .NET 10.
# From dotnet/ directory
dotnet test --project ./tests/Microsoft.Agents.AI.Abstractions.UnitTests -f net10.0Example: Running a single test in a specific project using .NET 10. Provide the full namespace, class name, and method name for the test you want to run:
# From dotnet/ directory
dotnet test --project ./tests/Microsoft.Agents.AI.Abstractions.UnitTests -f net10.0 --filter-query "/*/Microsoft.Agents.AI.Abstractions.UnitTests/AgentRunOptionsTests/CloningConstructorCopiesProperties"Multi-target framework tip
Most projects target multiple .NET frameworks. If the affected code does not use #if directives for framework-specific logic, pass -f net10.0 to speed up building and testing.
Package Restore tip
dotnet build will try and restore packages for all projects on each build, which can be slow. Unless packages have been changed, or it's the first time building the solution, add --no-restore to the build command to skip this step and speed up builds.
Just remember to run dotnet restore after pulling changes, making changes to project references, or when building for the first time.
Testing on Linux tip
Unit tests target both .NET Framework as well as .NET Core. When running on Linux, only the .NET Core tests can be run, as .NET Framework is not supported on Linux.
To run only the .NET Core tests, use the -f net10.0 option with dotnet test.
Microsoft Testing Platform (MTP)
Tests use the Microsoft Testing Platform via xUnit v3. Key differences from the legacy VSTest runner:
- `dotnet test` requires `--project` to specify a test project directly (positional arguments are no longer supported).
- Test output uses the MTP format (e.g.,
[✓112/x0/↓0]progress andTest run summary: Passed!). - TRX reports use
--report-xunit-trxinstead of--logger trx. - Code coverage uses
Microsoft.Testing.Extensions.CodeCoveragewith--coverage --coverage-output-format cobertura. - Running a test project directly is supported via
dotnet run --project <test-project>. This bypasses thedotnet testinfrastructure and runs the test executable directly with the MTP command line.
- Running tests across the solution with a filter may cause some projects to match zero tests, which MTP treats as a failure (exit code 8). Use
--ignore-exit-code 8to suppress this:
# Run all unit tests across the solution, ignoring projects with no matching tests
dotnet test --solution ./agent-framework-dotnet.slnx --no-build -f net10.0 --ignore-exit-code 8- Running tests with `--solution` for a specific TFM requires all projects in the solution to support that TFM. Not all projects target every framework (e.g., some are
net10.0-only). Use./dotnet/eng/scripts/New-FilteredSolution.ps1to generate a filtered solution:
# Generate a filtered solution for net472 and run tests
$filtered = ./dotnet/eng/scripts/New-FilteredSolution.ps1 -Solution dotnet/agent-framework-dotnet.slnx -TargetFramework net472
dotnet test --solution $filtered --no-build -f net472 --ignore-exit-code 8
# Exclude samples and keep only unit test projects
./dotnet/eng/scripts/New-FilteredSolution.ps1 -Solution dotnet/agent-framework-dotnet.slnx -TargetFramework net10.0 -ExcludeSamples -TestProjectNameFilter "*UnitTests*" -OutputPath dotnet/filtered-unit.slnx# Run tests via dotnet test (uses MTP under the hood)
dotnet test --project ./tests/Microsoft.Agents.AI.UnitTests -f net10.0
# Run tests with code coverage (Cobertura format)
dotnet test --project ./tests/Microsoft.Agents.AI.UnitTests -f net10.0 --coverage --coverage-output-format cobertura --coverage-settings ./tests/coverage.runsettings
# Run tests directly via dotnet run (MTP native command line)
dotnet run --project ./tests/Microsoft.Agents.AI.UnitTests -f net10.0
# Show MTP command line help
dotnet run --project ./tests/Microsoft.Agents.AI.UnitTests -f net10.0 -- -?Related skills
FAQ
What does build-and-test cover?
dotnet restore, build, test, and format commands with MTP xUnit v3 patterns for Agent Framework .NET projects.
When should I use build-and-test?
When building or testing changes in the Microsoft Agent Framework dotnet directory.
Is build-and-test safe to install?
Review the Security Audits panel on this page before installing in production.