stryker-mutator / stryker-net

Mutation testing for .NET core and .NET framework!
https://stryker-mutator.io
Apache License 2.0
1.79k stars 188 forks source link

No project references found. Please add a project reference to your test project and retry. #3065

Open MartijnvAdrichem opened 1 month ago

MartijnvAdrichem commented 1 month ago

Describe the bug A simple project without any stryker configuration gives this error. afbeelding

This happend because there was a test reference in the non-test project:

Removing this packageReference fixes the problem. Maybe with a better error message it would be quicker to find the root cause.

Logs For us to best assist you in diagnosing the problem we would ask you to run stryker with the option --log-to-file or -L and to attach the resulting logs to the issue. log-20241011.txt

Expected behavior calling 'dotnet stryker' should give a clear error when it only finds test projects.

Desktop (please complete the following information):

  • OS: Windows
  • Type of project Asp .NET Core
  • Framework Version .net 8
  • Stryker Version: latest
rouke-broersma commented 1 month ago

For the simple case I guess we could add a check that the solution only contains test projects, and provide a nice error message. For the more complex case with multiple valid projects and some invalid projects due to test framework references in non-test projects I'm not sure how we would detect/solve that.