Editéieren

Deelen iwwer


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

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:

  • Remove your manually defined entry point, typically Main method in Program.cs, and let the testing platform generate one for you.

  • Disable the generation of the entry point by setting the <GenerateTestingPlatformEntryPoint>false</GenerateTestingPlatformEntryPoint> MSBuild property.

  • 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.