.NET Testing Ecosystem: MSTest, NUnit, xUnit, VSTest & Microsoft.Testing.Platform
.NET provides multiple testing frameworks like MSTest, NUnit, and xUnit to write and execute unit tests. However, behind the scenes, there are several other components involved in running these tests, such as SDKs, adapters, runners, and test platforms. With the introduction of Microsoft's newer testing platform (MTP), things have evolved further. In this blog, we'll understand what these components are, how they work together, and how VSTest differs from Microsoft.Testing.Platform.
Ankush Jain
Lead Software Engineer (VP) | Software Architect

.NET provides multiple testing frameworks like MSTest, NUnit, and xUnit to write and execute unit tests. However, behind the scenes, there are several other components involved in running these tests, such as SDKs, adapters, runners, and test platforms. With the introduction of Microsoft's newer testing platform (MTP), things have evolved further. In this blog, we'll understand what these components are, how they work together, and how VSTest differs from Microsoft.Testing.Platform.
The big picture

Test frameworks
A Test framework provides attributes, assertions, fixtures, and test lifecycle.
All three provide the actual programming model for writing tests. You can choose any of them independently of whether you use VSTest or MTP, subject to their supported integrations.
xUnit.net
Popular community-driven testing framework.
[Fact]for normal tests[Theory]for parameterized tests[InlineData]for input data
NUnit
Mature framework with extensive features.
[Test][TestCase][SetUp],[TearDown]
MSTest
Microsoft's official testing framework.
[TestMethod][DataTestMethod][TestInitialize],[TestCleanup]
Microsoft.NET.Test.Sdk - traditional VSTest integration package
This is a package that you'll commonly see in existing .NET test projects. More precisely, Microsoft.NET.Test.Sdk is the traditional VSTest integration package. No longer required in MTP based test projects.
For example:
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="..." />Without this package explicitly added as a direct reference, dotnet test will fail to locate or execute your tests, even if the project compiles successfully.
Traditional VSTest project
<ItemGroup> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="..." /> <PackageReference Include="xunit" Version="..." /> <PackageReference Include="xunit.runner.visualstudio" Version="..." /></ItemGroup>Here:
Microsoft.NET.Test.Sdkprovides the VSTest test-project integration.xunitprovides the framework.xunit.runner.visualstudioprovides the VSTest adapter.
Test adapters
VSTest doesn't inherently understand what xUnit's [Fact] means. The xUnit adapter provides that integration.
VSTest uses a well-defined adapter contract.
VSTest | vAdapter contract | +---- xUnit VSTest Adapter | +---- NUnit VSTest Adapter | +---- MSTest VSTest AdapterEach adapter implements the VSTest integration interfaces and communicates with the VSTest infrastructure.
Consider an xUnit project:
<PackageReference Include="xunit" Version="..." /><PackageReference Include="xunit.runner.visualstudio" Version="..." /><PackageReference Include="Microsoft.NET.Test.Sdk" Version="..." />Each package has a different purpose:
| NuGet package | Purpose |
|---|---|
xunit | Framework: provides [Fact], [Theory], assertions |
xunit.runner.visualstudio | VSTest adapter: connects xUnit to VSTest |
Microsoft.NET.Test.Sdk | Traditional test project integration |
Similarly, for NUnit:
<PackageReference Include="NUnit" Version="..." /><PackageReference Include="NUnit3TestAdapter" Version="..." /><PackageReference Include="Microsoft.NET.Test.Sdk" Version="..." />And historically, MSTest:
<PackageReference Include="MSTest.TestFramework" Version="..." /><PackageReference Include="MSTest.TestAdapter" Version="..." /><PackageReference Include="Microsoft.NET.Test.Sdk" Version="..." />The adapter is the bridge between the framework and the test platform (VSTest or MTP).
Test Platforms - VSTest and Microsoft.Testing.Platform
VSTest (Traditional platform)
VSTest is Microsoft's established test execution platform.
It has been used for years by:
- Visual Studio Test Explorer
dotnet testvstest.console.exe- Azure DevOps test execution tasks
Its architecture generally relies on an external test host and adapters to discover and execute framework-specific tests.
When you execute test using dotnet test or Visual Studio Test Explorer, it executes vstest.console.exe, that starts a process. Now vstest.console.exe is not necessarily the process that directly loads your test DLL. It is the orchestrator. Typically, it launches testhost.exe, which loads the test assembly and executes the tests.
Traditional VSTest workflow

Microsoft.Testing.Platform - How it works?
Now consider an MTP-enabled test project.
Instead of relying on an external VSTest process and testhost architecture, MTP embeds its testing infrastructure into your test application.
For example:
<Project Sdk="MSTest.Sdk"> <PropertyGroup> <TargetFramework>net10.0</TargetFramework> </PropertyGroup></Project>The resulting project is executable.
Conceptually, the execution looks like this:

The important difference is that the MTP platform is part of the test application itself.
There is no requirement for an external vstest.console.exe or a separate VSTest testhost.exe to orchestrate its native execution.
CSPROJ for MTP-enabled test project
MSTest has a dedicated MSBuild Project SDK (MSTest.Sdk), but NUnit and xUnit don't use an equivalent project SDK in the same way.
Let's look at their actual .csproj files.
1. MSTest: Dedicated Project SDK
MSTest provides:
<Project Sdk="MSTest.Sdk"> <PropertyGroup> <TargetFramework>net10.0</TargetFramework> <Nullable>enable</Nullable> <ImplicitUsings>enable</ImplicitUsings> </PropertyGroup></Project>This is an MSBuild Project SDK, not just a NuGet package reference.
2. NUnit: Uses the regular .NET SDK
NUnit doesn't require a dedicated NUnit.Sdk project SDK for MTP.
Instead, it uses the normal Microsoft.NET.Sdk and enables its MTP runner through an MSBuild property.
Here's an example:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <TargetFramework>net10.0</TargetFramework> <OutputType>Exe</OutputType> <EnableNUnitRunner>true</EnableNUnitRunner> <Nullable>enable</Nullable> <ImplicitUsings>enable</ImplicitUsings> </PropertyGroup>
<ItemGroup> <PackageReference Include="NUnit" Version="4.x" /> <PackageReference Include="NUnit3TestAdapter" Version="5.x" /> </ItemGroup>
</Project>The important pieces:
| Configuration | Purpose |
|---|---|
Microsoft.NET.Sdk | Standard .NET project SDK |
NUnit | Test framework |
NUnit3TestAdapter | Provides traditional VSTest adapter and NUnit MTP runner support |
EnableNUnitRunner | Enables NUnit's MTP runner |
OutputType=Exe | Produces an executable test application |
Notice something interesting: NUnit3TestAdapter is still used even when enabling MTP. It now supports both VSTest and MTP.
You can also use:
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>for the older VSTest-bridged dotnet test integration, particularly with .NET 8/9 SDKs. For native MTP mode with .NET 10+, configure global.json instead.
Reference: NUnit MTP runner documentation.
3. xUnit: MTP support is built into xUnit v3
This is where xUnit is different from both MSTest and NUnit.
xUnit v3 has native MTP support. You don't need a separate xunit.mtp.runner package or an xunit.Sdk project SDK.
Example:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <TargetFramework>net10.0</TargetFramework> <OutputType>Exe</OutputType> <UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner> <Nullable>enable</Nullable> <ImplicitUsings>enable</ImplicitUsings> </PropertyGroup>
<ItemGroup> <PackageReference Include="xunit.v3" Version="3.x" /> </ItemGroup>
</Project>The important parts:
| Configuration | Purpose |
|---|---|
xunit.v3 | Framework and native MTP integration |
UseMicrosoftTestingPlatformRunner | Selects MTP as the runner |
OutputType=Exe | Executable test application |
Microsoft.NET.Sdk | Standard .NET project SDK |
For backward compatibility, you can additionally reference:
<PackageReference Include="xunit.runner.visualstudio" Version="3.x" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="..." />These are for VSTest compatibility, not requirements for native MTP execution.
VSTest and MTP Configuration in .NET 10
Starting with the .NET 10 SDK, dotnet test supports selecting the test platform through global.json.
Traditional VSTest:
{ "test": { "runner": "VSTest" }}Microsoft.Testing.Platform:
{ "test": { "runner": "Microsoft.Testing.Platform" }}The CLI command remains the same:
dotnet testThe SDK selects the appropriate execution platform based on the configuration.
For native MTP execution, avoid mixing VSTest-based and MTP-based projects in the same solution run configuration.
TRX Reporting Support
TRX (Test Results XML) is a test reporting format, not a feature exclusive to VSTest.
All three major frameworks support TRX reporting through both platforms.
| Framework | VSTest | MTP |
|---|---|---|
| MSTest | Supported | Supported |
| NUnit | Supported | Supported |
| xUnit v3 | Supported | Supported |
With VSTest, TRX reporting is available through the traditional test platform.
With MTP, TRX reporting is provided through the extension:
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="..." />Execute:
dotnet test -- --report-trxSpecify the results directory:
dotnet test -- --report-trx --results-directory ./TestResultsMSTest.Sdk includes TRX reporting in its default extension profile.
For NUnit and xUnit, ensure the TRX reporting extension is included in the MTP configuration.
Key takeaway
The biggest architectural change in modern .NET testing is the move from the traditional external VSTest execution architecture towards Microsoft.Testing.Platform's executable-first architecture. Testing frameworks such as MSTest, NUnit, and xUnit provide integrations for both ecosystems, allowing teams to retain their existing test frameworks while adopting the newer execution platform.