Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/azure/includes/dotnet-all.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
| Provisioning - Resources | NuGet [0.2.0](https://www.nuget.org/packages/Azure.Provisioning.Resources/0.2.0) | [docs](/dotnet/api/overview/azure/Provisioning.Resources-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [0.2.0](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Provisioning.Resources_0.2.0/sdk/provisioning/Azure.Provisioning.Resources/) |
| Purview Account | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Analytics.Purview.Account/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Analytics.Purview.Account-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.Account_1.0.0-beta.1/sdk/purview/Azure.Analytics.Purview.Account/) |
| Purview Administration | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Analytics.Purview.Administration/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Analytics.Purview.Administration-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.Administration_1.0.0-beta.1/sdk/purview/Azure.Analytics.Purview.Administration/) |
| Purview Data Map | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Analytics.Purview.DataMap/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Analytics.Purview.DataMap-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.DataMap_1.0.0-beta.1/sdk/purview/Azure.Analytics.Purview.DataMap/) |
| Purview Data Map | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.Analytics.Purview.DataMap/1.0.0-beta.2) | [docs](/dotnet/api/overview/azure/Analytics.Purview.DataMap-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.DataMap_1.0.0-beta.2/sdk/purview/Azure.Analytics.Purview.DataMap/) |
| Purview Scanning | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.Analytics.Purview.Scanning/1.0.0-beta.2) | [docs](/dotnet/api/overview/azure/Analytics.Purview.Scanning-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.Scanning_1.0.0-beta.2/sdk/purview/Azure.Analytics.Purview.Scanning/) |
| Purview Sharing | NuGet [1.0.0-beta.3](https://www.nuget.org/packages/Azure.Analytics.Purview.Sharing/1.0.0-beta.3) | [docs](/dotnet/api/overview/azure/Analytics.Purview.Sharing-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.Sharing_1.0.0-beta.3/sdk/purview/Azure.Analytics.Purview.Sharing/) |
| Purview Workflow | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.Analytics.Purview.Workflows/1.0.0-beta.2) | [docs](/dotnet/api/overview/azure/Analytics.Purview.Workflows-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.Workflows_1.0.0-beta.2/sdk/purview/Azure.Analytics.Purview.Workflows/) |
Expand Down
2 changes: 1 addition & 1 deletion docs/azure/includes/dotnet-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
| Purview Account | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Analytics.Purview.Account/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Analytics.Purview.Account-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.Account_1.0.0-beta.1/sdk/purview/Azure.Analytics.Purview.Account/) |
| Purview Administration | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Analytics.Purview.Administration/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Analytics.Purview.Administration-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.Administration_1.0.0-beta.1/sdk/purview/Azure.Analytics.Purview.Administration/) |
| Purview Catalog | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.Analytics.Purview.Catalog/1.0.0-beta.4) | [docs](/dotnet/api/overview/azure/Analytics.Purview.Catalog-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.4](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.Catalog_1.0.0-beta.4/sdk/purview/Azure.Analytics.Purview.Catalog/) |
| Purview Data Map | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Analytics.Purview.DataMap/1.0.0-beta.1) | [docs](/dotnet/api/overview/azure/Analytics.Purview.DataMap-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.1](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.DataMap_1.0.0-beta.1/sdk/purview/Azure.Analytics.Purview.DataMap/) |
| Purview Data Map | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.Analytics.Purview.DataMap/1.0.0-beta.2) | [docs](/dotnet/api/overview/azure/Analytics.Purview.DataMap-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.DataMap_1.0.0-beta.2/sdk/purview/Azure.Analytics.Purview.DataMap/) |
| Purview Scanning | NuGet [1.0.0-beta.2](https://www.nuget.org/packages/Azure.Analytics.Purview.Scanning/1.0.0-beta.2) | [docs](/dotnet/api/overview/azure/Analytics.Purview.Scanning-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.2](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.Scanning_1.0.0-beta.2/sdk/purview/Azure.Analytics.Purview.Scanning/) |
| Purview Share | NuGet [1.0.3-beta.20](https://www.nuget.org/packages/Azure.Analytics.Purview.Share/1.0.3-beta.20) | [docs](/dotnet/api/overview/azure/Analytics.Purview.Share-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.3-beta.20](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.Share_1.0.3-beta.20/sdk/purview/Azure.Analytics.Purview.Share) |
| Purview Sharing | NuGet [1.0.0-beta.3](https://www.nuget.org/packages/Azure.Analytics.Purview.Sharing/1.0.0-beta.3) | [docs](/dotnet/api/overview/azure/Analytics.Purview.Sharing-readme?view=azure-dotnet-preview&preserve-view=true) | GitHub [1.0.0-beta.3](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Analytics.Purview.Sharing_1.0.0-beta.3/sdk/purview/Azure.Analytics.Purview.Sharing/) |
Expand Down
14 changes: 5 additions & 9 deletions docs/core/extensions/globalization.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,11 @@ How you handle date and time values depends on whether they are displayed in the

Typically, when dates and times are displayed in the user interface, you should use the formatting conventions of the user's culture, which is defined by the <xref:System.Globalization.CultureInfo.CurrentCulture%2A?displayProperty=nameWithType> property and by the <xref:System.Globalization.DateTimeFormatInfo> object returned by the `CultureInfo.CurrentCulture.DateTimeFormat` property. The formatting conventions of the current culture are automatically used when you format a date by using any of these methods:

- The parameterless <xref:System.DateTime.ToString?displayProperty=nameWithType> method

- The <xref:System.DateTime.ToString%28System.String%29?displayProperty=nameWithType> method, which includes a format string

- The parameterless <xref:System.DateTimeOffset.ToString?displayProperty=nameWithType> method

- The <xref:System.DateTimeOffset.ToString%28System.String%29?displayProperty=nameWithType>, which includes a format string

- The [composite formatting](../../standard/base-types/composite-formatting.md) feature, when it is used with dates
- The parameterless <xref:System.DateTime.ToString?displayProperty=nameWithType> method.
- The <xref:System.DateTime.ToString%28System.String%29?displayProperty=nameWithType> method, which includes a format string.
- The parameterless <xref:System.DateTimeOffset.ToString?displayProperty=nameWithType> method.
- The <xref:System.DateTimeOffset.ToString%28System.String%29?displayProperty=nameWithType>, which includes a format string.
- The [composite formatting](../../standard/base-types/composite-formatting.md) feature, when it is used with dates.

The following example displays sunrise and sunset data twice for October 11, 2012. It first sets the current culture to Croatian (Croatia), and then to English (United Kingdom). In each case, the dates and times are displayed in the format that is appropriate for that culture.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ This extension is shipped as part of [Microsoft.Testing.Extensions.Retry](https:

The available options are as follows:

| Option | Description |
|-----------------------------------|--------------------------------------------------------------------------------------------------|
| retry-failed-tests | Reruns any failed tests until they pass or until the maximum number of attempts is reached. |
| retry-failed-tests-max-percentage | Avoids rerunning tests when the percentage of failed test cases crosses the specified threshold. |
| retry-failed-tests-max-tests | Avoids rerunning tests when the number of failed test cases crosses the specified limit. |
| Option | Description |
|---------------------------------------|--------------------------------------------------------------------------------------------------|
| `--retry-failed-tests` | Reruns any failed tests until they pass or until the maximum number of attempts is reached. |
| `--retry-failed-tests-max-percentage` | Avoids rerunning tests when the percentage of failed test cases crosses the specified threshold. |
| `--retry-failed-tests-max-tests` | Avoids rerunning tests when the number of failed test cases crosses the specified limit. |
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
---
title: Use Microsoft.Testing.Platform with VSTest mode of `dotnet test`
title: Use Microsoft.Testing.Platform in the VSTest mode of `dotnet test`
description: Learn how to run Microsoft.Testing.Platform tests through dotnet test.
author: nohwnd
ms.author: jajares
ms.date: 03/26/2025
---

# Use Microsoft.Testing.Platform with VSTest mode of `dotnet test`
# Use Microsoft.Testing.Platform in the VSTest mode of `dotnet test`

This article describes `dotnet test` integration for Microsoft.Testing.Platform that is provided by Microsoft.Testing.Platform.MSBuild when running with VSTest mode of `dotnet test`.
This article explains the integration of `dotnet test` for Microsoft.Testing.Platform, which is provided by Microsoft.Testing.Platform.MSBuild when running in the VSTest mode of `dotnet test`.

Before reading this article, it's advised to read [Testing with dotnet test](unit-testing-with-dotnet-test.md) first.
Before diving into this article, it's recommended to first read [Testing with dotnet test](unit-testing-with-dotnet-test.md), which explains the two modes of `dotnet test` (VSTest and MTP modes).

By default, `dotnet test` is using VSTest behavior to run tests. To enable support for `Microsoft.Testing.Platform` in `dotnet test`, there are two options:
By default, `dotnet test` uses VSTest to run tests. To enable support for `Microsoft.Testing.Platform` in `dotnet test`, you have two options:

1. Use `dotnet test` in VSTest mode, and specify `<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>` MSBuild property in your project file.
2. Use `dotnet test` in MTP mode, and enjoy more native support of MTP in `dotnet test`. This is only supported starting with .NET 10 SDK.
1. Use `dotnet test` in VSTest mode and specify `<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>` MSBuild property in your project file.
2. Use `dotnet test` in MTP mode for more native support of MTP in `dotnet test`, which is only supported starting with the .NET 10 SDK.

Both of these options are explained in details in the [Testing with dotnet test](unit-testing-with-dotnet-test.md) article.
Both options are explained in detail in the [Testing with dotnet test](unit-testing-with-dotnet-test.md) article.

> [!IMPORTANT]
> The remaining of this article is specific to the first option.
> The rest of this article is specific to the VSTest mode of `dotnet test`.
>
> [!CAUTION]
> Starting with .NET 10 SDK, it's recommended to not use the VSTest mode of `dotnet test` when running with Microsoft.Testing.Platform.

## Show failure per test

Expand Down
2 changes: 1 addition & 1 deletion docs/core/testing/unit-testing-mstest-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ You don't need anything else to build and run your tests and you can use the sam

> [!IMPORTANT]
> By switching to the `MSTest.Sdk`, you opt in to using the [MSTest runner (enables Microsoft.Testing.Platform for MSTest)](./unit-testing-mstest-runner-intro.md), including with [dotnet test](./microsoft-testing-platform-integration-dotnet-test.md). That requires modifying your CI and local CLI calls, and also impacts the available entries of the _.runsettings_. You can use `MSTest.Sdk` and still keep the old integrations and tools by instead switching the [runner](#select-the-runner).
> In more details, MSTest.Sdk, by default, will set `EnableMSTestRunner` and `TestingPlatformDotnetTestSupport` to true. For more information about dotnet test and its different modes for running Microsoft.Testing.Platform, see [Testing with dotnet test](./unit-testing-with-dotnet-test.md).
> By default, MSTest.Sdk sets `EnableMSTestRunner` and `TestingPlatformDotnetTestSupport` to true. For more information about dotnet test and its different modes for running Microsoft.Testing.Platform, see [Testing with dotnet test](./unit-testing-with-dotnet-test.md).

## Select the runner

Expand Down
12 changes: 5 additions & 7 deletions docs/core/testing/unit-testing-with-dotnet-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,16 @@ The process involves invoking the `VSTest` MSBuild target, which triggers other

### Run MTP projects with VSTest mode

`dotnet test` is typically designed to run VSTest projects in VSTest mode, as that was its original purpose. However, to run MTP projects in `dotnet test` VSTest mode, you can use the [Microsoft.Testing.Platform.MSBuild](https://www.nuget.org/packages/Microsoft.Testing.Platform.MSBuild). From the user's perspective, this support is enabled by setting the `TestingPlatformDotnetTestSupport` MSBuild property to true (it is false by default for backward compatibility reasons). In simple terms, setting this property to true will cause Microsoft.Testing.Platform.MSBuild to change the `VSTest` target behavior, redirecting it to call `InvokeTestingPlatform`. This is an MSBuild target included in Microsoft.Testing.Platform.MSBuild, responsible for correctly running MTP test applications as executables. This means that VSTest-specific command-line options are silently ignored in this mode, such as `--logger`. This implies that there should be a way to pass MTP-specific command-line options, such as `--report-trx`, which is equivalent to using `--logger trx` in VSTest. Given the current limitations of the `dotnet test` CLI, the only way to include MTP-specific arguments is by appending them after an additional `--`. For instance, `dotnet test -- --report-trx`.
`dotnet test` was designed to run VSTest projects in VSTest mode. However, you can run MTP projects in `dotnet test` VSTest mode by using the [Microsoft.Testing.Platform.MSBuild](https://www.nuget.org/packages/Microsoft.Testing.Platform.MSBuild) package. From the user's perspective, this support is enabled by setting the `TestingPlatformDotnetTestSupport` MSBuild property to `true` (it's `false` by default for backward-compatibility reasons). When this property is set to `true`, Microsoft.Testing.Platform.MSBuild changes the `VSTest` target behavior, redirecting it to call `InvokeTestingPlatform`. `InvokeTestingPlatform` is an MSBuild target included in Microsoft.Testing.Platform.MSBuild that's responsible for correctly running MTP test applications as executables. VSTest-specific command-line options, such as `--logger`, are silently ignored in this mode. To include MTP-specific arguments, such as `--report-trx`, you must append them after an additional `--`. For example, `dotnet test -- --report-trx`.

> [!NOTE]
> MSTest and NUnit use [Microsoft.Testing.Extensions.VSTestBridge](https://www.nuget.org/packages/Microsoft.Testing.Extensions.VSTestBridge). When you set `EnableMSTestRunner` or `EnableNUnitRunner` (the properties used to enable MTP), your test project become supporting both VSTest and Microsoft.Testing.Platform.
> In that case, if you are using VSTest mode of `dotnet test` and not setting `TestingPlatformDotnetTestSupport` to true, you are actually running completely with VSTest, as if `EnableMSTestRunner` and `EnableNUnitRunner` are not there.
> MSTest and NUnit use the [Microsoft.Testing.Extensions.VSTestBridge](https://www.nuget.org/packages/Microsoft.Testing.Extensions.VSTestBridge) package. By setting `EnableMSTestRunner` or `EnableNUnitRunner` (which enables Microsoft.Testing.Platform), your test project will support both VSTest and Microsoft.Testing.Platform.
> In that scenario, if you use the VSTest mode of `dotnet test` and do not set `TestingPlatformDotnetTestSupport` to true, you are essentially running entirely with VSTest, as if `EnableMSTestRunner` and `EnableNUnitRunner` are not set to true.
>
> [!NOTE]
> It's highly recommended that you set the `TestingPlatformDotnetTestSupport` property in `Directory.Build.props`. That way, you don't have to add it to every test project file, and you don't risk introducing a new project that doesn't set this property and end up with a solution where some projects are VSTest while others are Microsoft.Testing.Platform, which may not work correctly and is unsupported scenario.
> It is highly recommended to set the `TestingPlatformDotnetTestSupport` property in `Directory.Build.props`. This ensures that you don't need to add it to every test project file individually. Additionally, it prevents the risk of introducing a new test project that doesn't set this property, which could result in a solution where some projects use VSTest while others use Microsoft.Testing.Platform. This mixed configuration might not work correctly and is an unsupported scenario.

The following command-line options of `dotnet test` command in VSTest mode are supported by Microsoft.Testing.Platform. These options are build-specific and not passed down to VSTest, which is why they work well with MTP.

The list below described all `dotnet test` command line options that are supported by `Microsoft.Testing.Platform`:
The following list outlines the command-line options of `dotnet test` command in VSTest mode that are supported by Microsoft.Testing.Platform. These options are specific to the build process and not passed down to VSTest, which is why they work with MTP.

- `-a|--arch <ARCHITECTURE>`
- `--artifacts-path <ARTIFACTS_DIR>`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ These MSBuild tasks provide template validation and [localization of the templat

## Pack and install

Save the project file. Before building the template package, verify that your folder structure is correct. Any template you want to pack should be placed in the _templates_ folder, in its own folder. The folder structure should look similar to the following hierarchy:
Save the project file. Before building the template package, verify that your folder structure is correct. Any template you want to pack should be placed in the _content_ folder, in its own folder. The folder structure should look similar to the following hierarchy:

```console
working
Expand Down
Loading
Loading