Skip to content

Commit 988e381

Browse files
authored
Update MTP and Fakes documentation (#44698)
1 parent 10288a5 commit 988e381

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

docs/core/testing/unit-testing-platform-faq.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ ms.author: amauryleve
66
ms.date: 07/09/2024
77
---
88

9-
# Microsoft.Testing.Platform FAQ
9+
# Microsoft.Testing.Platform and extensions FAQ
1010

1111
This article contains answers to commonly asked questions about `Microsoft.Testing.Platform`.
1212

13-
## error CS8892: Method 'TestingPlatformEntryPoint.Main(string[])' will not be used as an entry point because a synchronous entry point 'Program.Main(string[])' was found
13+
## Microsoft.Testing.Platform.MSBuild
14+
15+
### error CS8892: Method 'TestingPlatformEntryPoint.Main(string[])' will not be used as an entry point because a synchronous entry point 'Program.Main(string[])' was found
1416

1517
Manually defining an entry point (`Main`) in a test project or referencing a test project from an application that already has an entry point results in a conflict with the entry point generated by `Microsoft.Testing.Platform`. To avoid this issue, take one of these steps:
1618

@@ -19,3 +21,12 @@ Manually defining an entry point (`Main`) in a test project or referencing a tes
1921
- Disable the generation of the entry point by setting the `<GenerateTestingPlatformEntryPoint>false</GenerateTestingPlatformEntryPoint>` MSBuild property.
2022

2123
- Completely disable the transitive dependency to `Microsoft.Testing.Platform.MSBuild` by setting the `<IsTestingPlatformApplication>false</IsTestingPlatformApplication>` MSBuild property in the project that references a test project. This is needed when you reference a test project from a non-test project, for example, a console app that references a test application.
24+
25+
## Microsoft.Testing.Extensions.Fakes
26+
27+
### Fakes error Failed to resolve profiler path from COR_PROFILER_PATH and COR_PROFILER environment variables
28+
29+
This error can occur if not all of the Fakes assemblies are present in the bin folder.
30+
31+
- Ensure that the project either uses the [MSTest.SDK](./unit-testing-mstest-sdk.md) or references [Microsoft.Testing.Extensions.Fakes](./unit-testing-platform-extensions-fakes.md).
32+
- For .NET Framework projects, avoid setting `<PlatformTarget>AnyCPU</PlatformTarget>` as this results in NuGet not copying all files to the bin folder.

docs/core/testing/unit-testing-platform-vs-vstest.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ VSTest is extensible and common types are placed in [Microsoft.TestPlatform.Obje
3636

3737
Microsoft.Testing.Platform is based on [Microsoft.Testing.Platform](https://www.nuget.org/packages/Microsoft.Testing.Platform) NuGet package and other libraries in the `Microsoft.Testing.*` namespace. Like VSTest, the `Microsoft.Testing.Platform` is open-source and has a [microsoft/testfx](https://github.com/microsoft/testfx/tree/main/src/Platform/Microsoft.Testing.Platform) GitHub repository.
3838

39-
## Communication protocol (preview)
39+
## Communication protocol
4040

4141
> [!NOTE]
42-
> The Visual Studio Test Explorer supports the Microsoft.Testing.Platform protocol in the **preview** versions since 17.10 onward. If you run/debug your tests using earlier versions of Visual Studio, Test Explorer will use `vstest.console.exe` and the old protocol to run these tests.
42+
> The Visual Studio Test Explorer supports the Microsoft.Testing.Platform protocol since 17.12 onward. If you run/debug your tests using earlier versions of Visual Studio, Test Explorer will use `vstest.console.exe` and the old protocol to run these tests.
4343
4444
Microsoft.Testing.Platform uses a JSON-RPC based protocol to communicate between Visual Studio and the test runner process. The protocol is documented in the [MSTest GitHub repository](https://github.com/microsoft/testfx/tree/main/docs/mstest-runner-protocol).
4545

@@ -49,6 +49,8 @@ VSTest also uses a JSON based communication protocol, but it's not JSON-RPC base
4949

5050
To disable the use of the new protocol in Test Explorer, you can edit your project to add the following property: `<DisableTestingPlatformServerCapability>true</DisableTestingPlatformServerCapability>`.
5151

52+
You can also go to Preview Features options in Visual Studio and deselect the "Use testing platform server mode" option.
53+
5254
## Executables
5355

5456
VSTest ships multiple executables, notably `vstest.console.exe`, `testhost.exe`, and `datacollector.exe`. However, MSTest is embedded directly into your test project and doesn't ship any other executables. The executable your test project compiles to is used to host all the testing tools and carry out all the tasks needed to run tests.

0 commit comments

Comments
 (0)