Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
19 changes: 19 additions & 0 deletions docs/core/testing/unit-testing-platform-faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Microsoft.Testing.Platform FAQ
description: Get answers to frequently asked questions about Microsoft.Testing.Platform.
author: Evangelink
ms.author: amauryleve
ms.date: 07/09/2024
---

# Microsoft.Testing.Platform FAQ

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

## error CS8892: Method 'TestingPlatformEntryPoint.Main(string[])' will not be used as an entry point because a synchronous entry point 'Program.Main(string[])' was found

When you are manually defining an entry point (`Main`), there will be a conflict with the entry point generated by `Microsoft.Testing.Platform`. To avoid this issue you can either:

- Disable the generation of the entry point by setting the following MSBuild property `<GenerateTestingPlatformEntryPoint>false</GenerateTestingPlatformEntryPoint>`. This is the most common scenario.

- Fully disable the transitive dependency to `Microsoft.Testing.Platform.MSBuild` by setting the following MSBuild property `<IsTestingPlatformApplication>false</IsTestingPlatformApplication>`. Note that this is usually required only when you are referencing the test application from a non-test application (e.g. You have a console application referencing a test application).
11 changes: 11 additions & 0 deletions docs/core/testing/unit-testing-platform-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,17 @@ Specifies the minimum number of tests that are expected to run. By default, at l

The directory where the test results are going to be placed. If the specified directory doesn't exist, it's created. The default is `TestResults` in the directory that contains the test application.

## MSBuild integration

The NuGet package [Microsoft.Testing.Platform.MSBuild](https://www.nuget.org/packages/Microsoft.Testing.Platform.MSBuild) provides various integrations for `Microsoft.Testing.Platform` with MSBuild.

- Support for `dotnet test`, see [dotnet test integration](./unit-testing-platform-integration-dotnet-test.md) for more information.
- Support for `ProjectCapability` required by `Visual Studio` and `Visual Studio Code` Test Explorers.
- Automatic generation of the entry point (`Main` method)

> [!NOTE]
> This integration works in a transitive way (a project that references another project referencing this package will behave as if it references the package) and can be disabled through the `IsTestingPlatformApplication` MSBuild property.

## See also

- [Microsoft.Testing.Platform and VSTest comparison](unit-testing-platform-vs-vstest.md)
Expand Down