Skip to content

Commit 63d82e4

Browse files
authored
Update MSTest.Sdk docs to note IsTestApplication MSBuild property (#48016)
1 parent 5f083f6 commit 63d82e4

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

docs/core/testing/unit-testing-mstest-sdk.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ By default, the MSTest SDK discovers and runs your tests using the [MSTest runne
1919
You can enable `MSTest.Sdk` in a project by simply updating the `Sdk` attribute of the `Project` node of your project:
2020

2121
```xml
22-
<Project Sdk="MSTest.Sdk/3.8.3">
22+
<Project Sdk="MSTest.Sdk/3.10.2">
2323

2424
<PropertyGroup>
2525
<TargetFramework>net8.0</TargetFramework>
@@ -29,7 +29,7 @@ You can enable `MSTest.Sdk` in a project by simply updating the `Sdk` attribute
2929
```
3030

3131
> [!NOTE]
32-
> `/3.8.3` is given as example and can be replaced with any newer version.
32+
> `/3.10.2` is given as example and can be replaced with any newer version.
3333
3434
To simplify handling of versions, we recommend setting the SDK version at solution level using the _global.json_ file. For example, your project file would look like:
3535

@@ -48,7 +48,7 @@ Then, specify the `MSTest.Sdk` version in the _global.json_ file as follows:
4848
```json
4949
{
5050
"msbuild-sdks": {
51-
"MSTest.Sdk": "3.8.3"
51+
"MSTest.Sdk": "3.10.2"
5252
}
5353
}
5454
```
@@ -63,6 +63,10 @@ You don't need anything else to build and run your tests and you can use the sam
6363
> 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).
6464
> 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).
6565
66+
## Test utility helper libraries
67+
68+
If the project that uses MSTest.Sdk is intended to be a test utility helper library, and doesn't by itself contain any runnable tests, the project should have `<IsTestApplication>false</IsTestApplication>`.
69+
6670
## Select the runner
6771

6872
By default, MSTest SDK relies on [Microsoft.Testing.Platform](./unit-testing-mstest-runner-intro.md), but you can switch to [VSTest](/visualstudio/test/vstest-console-options) by adding the property `<UseVSTest>true</UseVSTest>`.
@@ -111,7 +115,7 @@ You can set the profile using the property `TestingExtensionsProfile` with one o
111115
Here's a full example, using the `None` profile:
112116

113117
```xml
114-
<Project Sdk="MSTest.Sdk/3.8.3">
118+
<Project Sdk="MSTest.Sdk/3.10.2">
115119

116120
<PropertyGroup>
117121
<TargetFramework>net8.0</TargetFramework>
@@ -138,7 +142,7 @@ Extensions can be enabled and disabled by MSBuild properties with the pattern `E
138142
For example, to enable the crash dump extension (NuGet package [Microsoft.Testing.Extensions.CrashDump](https://www.nuget.org/packages/Microsoft.Testing.Extensions.CrashDump)), you can use the following property `EnableMicrosoftTestingExtensionsCrashDump` set to `true`:
139143

140144
```xml
141-
<Project Sdk="MSTest.Sdk/3.8.3">
145+
<Project Sdk="MSTest.Sdk/3.10.2">
142146

143147
<PropertyGroup>
144148
<TargetFramework>net8.0</TargetFramework>
@@ -160,7 +164,7 @@ This property pattern can be used to enable an additional extension on top of th
160164
You can also disable an extension that's coming from the selected profile. For example, disable the `MS Code Coverage` extension by setting `<EnableMicrosoftTestingExtensionsCodeCoverage>false</EnableMicrosoftTestingExtensionsCodeCoverage>`:
161165

162166
```xml
163-
<Project Sdk="MSTest.Sdk/3.8.3">
167+
<Project Sdk="MSTest.Sdk/3.10.2">
164168

165169
<PropertyGroup>
166170
<TargetFramework>net8.0</TargetFramework>
@@ -232,7 +236,7 @@ Add the version to your `global.json`:
232236
```json
233237
{
234238
"msbuild-sdks": {
235-
"MSTest.Sdk": "3.8.3"
239+
"MSTest.Sdk": "3.10.2"
236240
}
237241
}
238242
```

0 commit comments

Comments
 (0)