Microsoft.Testing.Platform and extensions FAQ
This article contains answers to commonly asked questions about Microsoft.Testing.Platform
.
Microsoft.Testing.Platform.MSBuild
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.
Microsoft.Testing.Extensions.Fakes
Fakes error Failed to resolve profiler path from COR_PROFILER_PATH and COR_PROFILER environment variables
This error can occur if not all of the Fakes assemblies are present in the bin folder.
- Ensure that the project either uses the MSTest.SDK or references Microsoft.Testing.Extensions.Fakes.
- For .NET Framework projects, avoid setting
<PlatformTarget>AnyCPU</PlatformTarget>
as this results in NuGet not copying all files to the bin folder.