Project reference issue (No project references found)
See original GitHub issueI have used this very basic config. in a single project
<!-- example.csproj -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="StrykerMutator.Core" Version="0.9.0" />
<PackageReference Include="StrykerMutator.DotNetCoreCli" Version="0.9.0" />
</ItemGroup>
</Project>
Later I ran the same commands as in docs.
dotnet stryker
dotnet stryker --project-file example.csproj
dotnet stryker --config-file-path stryker.config.json
dotnet stryker --test-runner "vstest" --reporters "['Html', 'ConsoleReport', 'ConsoleProgressBar']" --log-console "debug"
Always, I see the same logs and mutation won’t start, however the unit test has no problem and it is running fine.
# terminal output 1
Stryker.NET failed to mutate your project. For more information see the logs below:
Project reference issue.
No project reference matched your --project-file=evaluator.csproj
Choose one of the following references:
# terminal output 2
Stryker.NET failed to mutate your project. For more information see the logs below:
Project reference issue.
No project references found. Please add a project reference to your test project and retry.
It would be appreciated if you have any suggestion that would help.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
csproj keeps losing referenced project references in ...
Sometimes the projects are literally missing from the references tree, other times they are visible. When right clicking "add reference" the ...
Read more >Troubleshoot broken references - Visual Studio
If projects are shared on different computers, some references might not be found when a component is located in a different directory.
Read more >Project references not working for VS Enterprise 2019 ...
When I open a solution which works fine on vs 2017 using VS 2019 enterprise preview, the project references do not work.
Read more >Manage references in a project - Visual Studio (Windows)
File references are direct references to assemblies outside the context of a Visual Studio project. You create them by using the Browse tab...
Read more >References to projects does not work if ProjectGuid in ...
But when I open the .cs file, I get error reports stating that the reference could not be found even though it is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @nohwnd
We no longer provide stryker as a dotnet core cli extensibility model tool, it is packaged as a dotnet global tool since version 0.10.0. So no references need to be added to your projects.
Do you have any issues using the global tool?
Hi Masifi, Stryker is trying to find out what project should be mutated. It does by scanning for project references in your test csproj file. As I see in your example.csproj you have no project references in your project file. Thus stryker cannot find a project to mutate.
Stryker needs to find an external project to mutate as it should not mutate your test code, but your logic. It is best practice to place your logic outside of your test project.
You can see an example project file in our integration test.
When you add the project reference to your test project stryker should run fine 👍