Microsoft Testing Platform and .Net 10

July 8, 2026    .Net AutomatedTesting

Microsoft Testing Platform and .Net 10

I created a new project using .Net 10 and it failed in my pipeline when running the tests. I wasn’t aware of the Microsft Testing Platform (MTP) and how it has changed in .Net 10.

What is MTP?

The Microsoft Testing Platform “is a lightweight and portable alternative to VSTest for running tests in all contexts, including continuous integration (CI) pipelines, CLI, Visual Studio Test Explorer, and VS Code Test Explorer. MTP is embedded directly in your test projects, and there’s no other app dependencies, such as vstest.console or dotnet test needed to run your tests.” It is open source and available on GitHub . Checkout the pillars in this link. It looks like it’s going in a great direction.

There are many sub articles from that link. I’ll point out the features page that walks through many scenarios.

This Microsoft Learn article is your best source about dotnet test and using Microsoft Testing Platform.

What’s new?

Way back in March, 2025, this article, MSTest 3.8: Top 10 features to supercharge your .NET tests , touted the improvements.

I see the open source nature, moving from the old VSTest to allow more innovation and improvements, no dependencies and analyzers as very useful. There’s still a lot of things I’m not aware of.

Pipeline Yaml Changes Needed

I had to change my yaml pipline with support for existing projects in VSTest and new projects in MTP. IT was mostly due to the cli switches for the code coverage and trx report.

- parameters:
  # new testing mode is the Microsoft Testing Platform: https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-with-dotnet-test
  # this is designated in the global.json
  - name: mtp
    type: string
    default: "true"
    values:
      - "true"
      - "false"
jobs:
  - job: BuildAndTest
    displayName: "Build and Test"
    steps:

    ..... other steps see the github link below .....
    - ${{ if eq(parameters.mtp, 'true') }}:
        - task: DotNetCoreCLI@2
          displayName: 'Run tests and collect coverage (MTP)'
          inputs:
            command: test
            projects: '**/*Tests/*.csproj'
            # need Microsoft.Testing.Extensions.TrxReport for Trx
            # need Microsoft.Testing.Extensions.CodeCoverag for -Coverage
            arguments: >
              --configuration ${{ parameters.buildConfiguration }}
              --report-trx
              --coverage
              --coverage-output-format cobertura

      - ${{ if ne(parameters.mtp, 'true') }}:
        - task: DotNetCoreCLI@2
          displayName: 'Run tests and collect coverage (XPlat/VSTest)'
          inputs:
            command: test
            projects: '**/*Tests/*.csproj'
            arguments: >
              --configuration ${{ parameters.buildConfiguration }}
              --logger trx
              --collect:"XPlat Code Coverage"
              --DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura

Here is my full example: https://github.com/aligneddev/ADOYamlTemplates/blob/main/Templates/netBuildAndTest.yml .

Csproj Changes Needed

File New Project in .Net 10 gave me this setup. I’m using Xunit.Here’s part of the .csproj file:


  <ItemGroup>
    <Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
  </ItemGroup>

  <ItemGroup>
    <Using Include="Xunit" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.9.0" />
    <PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="2.3.0" />
    <PackageReference Include="Microsoft.Testing.Platform" Version="2.3.0" />
    <PackageReference Include="NSubstitute" Version="5.3.0" />
    <PackageReference Include="xunit.v3.mtp-v2" Version="3.2.2" />
  </ItemGroup>

File New project added the xunit.runner.json file. There must be more options that can be set.

{
    "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json"
}

I added a global.json file so it would use MTP.

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


Watch the Story for Good News
I gladly accept BTC Lightning Network tips at strike.me/aligned

Check out my Resources Page for referrals that would help me.


Swan logo
Use Swan Bitcoin to onramp with low fees and automatic daily cost averaging and get $10 in BTC when you sign up.

Use the Brave browser to block ads and trackers! Use Brave