Engineering scalable systems, cloud-native applications, and AI-powered solutions.

.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

Ankush Jain

Lead Software Engineer (VP) | Software Architect

Published Dec 1, 2026Updated Nov 30, 2026
.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.

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:

xml
<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

xml
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="..." />
<PackageReference Include="xunit" Version="..." />
<PackageReference Include="xunit.runner.visualstudio" Version="..." />
</ItemGroup>

Here:

  • Microsoft.NET.Test.Sdk provides the VSTest test-project integration.
  • xunit provides the framework.
  • xunit.runner.visualstudio provides 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.

plain text
VSTest
|
v
Adapter contract
|
+---- xUnit VSTest Adapter
|
+---- NUnit VSTest Adapter
|
+---- MSTest VSTest Adapter

Each adapter implements the VSTest integration interfaces and communicates with the VSTest infrastructure.

Consider an xUnit project:

xml
<PackageReference Include="xunit" Version="..." />
<PackageReference Include="xunit.runner.visualstudio" Version="..." />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="..." />

Each package has a different purpose:

NuGet packagePurpose
xunitFramework: provides [Fact], [Theory], assertions
xunit.runner.visualstudioVSTest adapter: connects xUnit to VSTest
Microsoft.NET.Test.SdkTraditional test project integration

Similarly, for NUnit:

xml
<PackageReference Include="NUnit" Version="..." />
<PackageReference Include="NUnit3TestAdapter" Version="..." />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="..." />

And historically, MSTest:

xml
<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 test
  • vstest.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:

xml
<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:

xml
<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:

xml
<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:

ConfigurationPurpose
Microsoft.NET.SdkStandard .NET project SDK
NUnitTest framework
NUnit3TestAdapterProvides traditional VSTest adapter and NUnit MTP runner support
EnableNUnitRunnerEnables NUnit's MTP runner
OutputType=ExeProduces 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:

xml
<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:

xml
<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:

ConfigurationPurpose
xunit.v3Framework and native MTP integration
UseMicrosoftTestingPlatformRunnerSelects MTP as the runner
OutputType=ExeExecutable test application
Microsoft.NET.SdkStandard .NET project SDK

For backward compatibility, you can additionally reference:

xml
<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:

json
{
"test": {
"runner": "VSTest"
}
}

Microsoft.Testing.Platform:

json
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}

The CLI command remains the same:

bash
dotnet test

The 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.

FrameworkVSTestMTP
MSTestSupportedSupported
NUnitSupportedSupported
xUnit v3SupportedSupported

With VSTest, TRX reporting is available through the traditional test platform.

With MTP, TRX reporting is provided through the extension:

xml
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport"
Version="..." />

Execute:

bash
dotnet test -- --report-trx

Specify the results directory:

bash
dotnet test -- --report-trx --results-directory ./TestResults

MSTest.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.

Official Documentation

Have feedback or thoughts?

Discuss this article or share it on Twitter / GitHub.