testfx
testfx copied to clipboard
TestingPlatformEntryPoint.Main is generated in project referencing unit test project
Describe the bug
After upgrading MSTest (V2) from version 3.1.1 to version 3.4.3, the following diagnostic is reported for one of our solutions:
error CS8892: Method 'TestingPlatformEntryPoint.Main(string[])' will not be used as an entry point because a synchronous entry point 'Program.Main(string[])' was found
This diagnostic is reported when we have a (console) project - that is not a unit test project - which references a unit test project. I don't see why such an entrypoint is generated in projects that reference a unit test project. It should only be generated in the unit test project itself.
Steps To Reproduce
- Clone https://github.com/drieseng/duplicate-entrypoint.git
- Open the DuplicateEntrypoint.sln solution in Visual Studio.
- Build the solution.
Expected behavior
No warnings or error are reported.
Actual behavior
The following diagnostic is reported:
error CS8892: Method 'TestingPlatformEntryPoint.Main(string[])' will not be used as an entry point because a synchronous entry point 'Program.Main(string[])' was found