You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/core/extensions/globalization.md
+5-9Lines changed: 5 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,15 +128,11 @@ How you handle date and time values depends on whether they are displayed in the
128
128
129
129
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:
130
130
131
-
- The parameterless <xref:System.DateTime.ToString?displayProperty=nameWithType> method
132
-
133
-
- The <xref:System.DateTime.ToString%28System.String%29?displayProperty=nameWithType> method, which includes a format string
134
-
135
-
- The parameterless <xref:System.DateTimeOffset.ToString?displayProperty=nameWithType> method
136
-
137
-
- The <xref:System.DateTimeOffset.ToString%28System.String%29?displayProperty=nameWithType>, which includes a format string
138
-
139
-
- The [composite formatting](../../standard/base-types/composite-formatting.md) feature, when it is used with dates
131
+
- The parameterless <xref:System.DateTime.ToString?displayProperty=nameWithType> method.
132
+
- The <xref:System.DateTime.ToString%28System.String%29?displayProperty=nameWithType> method, which includes a format string.
133
+
- The parameterless <xref:System.DateTimeOffset.ToString?displayProperty=nameWithType> method.
134
+
- The <xref:System.DateTimeOffset.ToString%28System.String%29?displayProperty=nameWithType>, which includes a format string.
135
+
- The [composite formatting](../../standard/base-types/composite-formatting.md) feature, when it is used with dates.
140
136
141
137
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.
Copy file name to clipboardExpand all lines: docs/core/testing/microsoft-testing-platform-integration-dotnet-test.md
+12-9Lines changed: 12 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,29 @@
1
1
---
2
-
title: Use Microsoft.Testing.Platform with VSTest mode of `dotnet test`
2
+
title: Use Microsoft.Testing.Platform in the VSTest mode of `dotnet test`
3
3
description: Learn how to run Microsoft.Testing.Platform tests through dotnet test.
4
4
author: nohwnd
5
5
ms.author: jajares
6
6
ms.date: 03/26/2025
7
7
---
8
8
9
-
# Use Microsoft.Testing.Platform with VSTest mode of `dotnet test`
9
+
# Use Microsoft.Testing.Platform in the VSTest mode of `dotnet test`
10
10
11
-
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`.
11
+
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`.
12
12
13
-
Before reading this article, it's advised to read [Testing with dotnet test](unit-testing-with-dotnet-test.md) first.
13
+
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).
14
14
15
-
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:
15
+
By default, `dotnet test`uses VSTest to run tests. To enable support for `Microsoft.Testing.Platform` in `dotnet test`, you have two options:
16
16
17
-
1. Use `dotnet test` in VSTest mode, and specify `<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>` MSBuild property in your project file.
18
-
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.
17
+
1. Use `dotnet test` in VSTest mode and specify `<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>` MSBuild property in your project file.
18
+
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.
19
19
20
-
Both of these options are explained in details in the [Testing with dotnet test](unit-testing-with-dotnet-test.md) article.
20
+
Both options are explained in detail in the [Testing with dotnet test](unit-testing-with-dotnet-test.md) article.
21
21
22
22
> [!IMPORTANT]
23
-
> The remaining of this article is specific to the first option.
23
+
> The rest of this article is specific to the VSTest mode of `dotnet test`.
24
+
>
25
+
> [!CAUTION]
26
+
> Starting with .NET 10 SDK, it's recommended to not use the VSTest mode of `dotnet test` when running with Microsoft.Testing.Platform.
Copy file name to clipboardExpand all lines: docs/core/testing/unit-testing-mstest-sdk.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ You don't need anything else to build and run your tests and you can use the sam
61
61
62
62
> [!IMPORTANT]
63
63
> 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).
64
-
> 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).
64
+
> 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).
Copy file name to clipboardExpand all lines: docs/core/testing/unit-testing-with-dotnet-test.md
+5-7Lines changed: 5 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,18 +26,16 @@ The process involves invoking the `VSTest` MSBuild target, which triggers other
26
26
27
27
### Run MTP projects with VSTest mode
28
28
29
-
`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`.
29
+
`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`.
30
30
31
31
> [!NOTE]
32
-
> 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.
33
-
> 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.
32
+
> 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.
33
+
> 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.
34
34
>
35
35
> [!NOTE]
36
-
> 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.
36
+
> 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.
37
37
38
-
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.
39
-
40
-
The list below described all `dotnet test` command line options that are supported by `Microsoft.Testing.Platform`:
38
+
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.
Copy file name to clipboardExpand all lines: docs/core/tutorials/cli-templates-create-template-package.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -127,7 +127,7 @@ These MSBuild tasks provide template validation and [localization of the templat
127
127
128
128
## Pack and install
129
129
130
-
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:
130
+
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:
0 commit comments