You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When <TargetFramework> is set in Directory.Build.props Stryker doesn't work.
Logs
I have a a solution folder with a Directory.Build.props that specifies <TargetFramework>net9.0</TargetFramework> and there are no <TargetFramework> in the .csproj files. The project to mutate and the unit test project are in subdirectories and the unit test project has a reference to the project to mutate. When executing dotnet stryker --verbosity debug in the unit test project I get the following console output:
[13:07:16 INF] Logging enabled at level Debug
Version: 4.4.1
[13:07:16 DBG] Stryker starting, version: 4.4.1
[13:07:16 DBG] Stryker started with options: [REMOVED FOR BREVITY]
[13:07:16 INF] Analysis starting.
[13:07:16 DBG] Using C:\Users\[REDACTED]\[REDACTED].UnitTests\[REDACTED].UnitTests.csproj as test project
[13:07:16 INF] Analyzing 1 test project(s).
[13:07:16 DBG] Analyzing 0 projects.
[13:07:16 DBG] Analyzing [REDACTED].UnitTests.csproj
[13:07:22 DBG] Analysis of project [REDACTED].UnitTests.csproj succeeded.
[13:07:23 DBG] Analyzing ..\[REDACTED]\[REDACTED].csproj
[13:07:29 DBG] Analysis of project ..\[REDACTED]\[REDACTED].csproj succeeded.
[13:07:29 INF] Analysis complete.
[13:07:29 INF] Time Elapsed 00:00:13.2623456
Stryker.NET failed to mutate your project. For more information see the logs below:
No project references found. Please add a project reference to your test project and retry.
Expected behavior
According to the logs Stryker correctly detects the project to mutate and should go ahead and perform the tests.
Adding <TargetFramework>net9.0</TargetFramework> to both .csproj files fixes the problem.
Desktop
OS: Windows
Type of project: "core"
Framework Version: .NET 9.0
Stryker Version: 4.4.1
Additional context
I haven't tried to locate the actual problem in the source code. Even if it's not worth fixing it might be helpful to explain this in the documentation. This is my first time using Stryker and it took me quite some time to understand why my project didn't work with Stryker despite following the clear and useful instructions in "Getting started".
The text was updated successfully, but these errors were encountered:
@dupdob Yes, that's exactly the issue. The <TargetFramework> is not being picked up correctly so probably not something that can be fixed by this project.
Describe the bug
When
<TargetFramework>
is set inDirectory.Build.props
Stryker doesn't work.Logs
I have a a solution folder with a
Directory.Build.props
that specifies<TargetFramework>net9.0</TargetFramework>
and there are no<TargetFramework>
in the.csproj
files. The project to mutate and the unit test project are in subdirectories and the unit test project has a reference to the project to mutate. When executingdotnet stryker --verbosity debug
in the unit test project I get the following console output:Expected behavior
According to the logs Stryker correctly detects the project to mutate and should go ahead and perform the tests.
Adding
<TargetFramework>net9.0</TargetFramework>
to both.csproj
files fixes the problem.Desktop
Additional context
I haven't tried to locate the actual problem in the source code. Even if it's not worth fixing it might be helpful to explain this in the documentation. This is my first time using Stryker and it took me quite some time to understand why my project didn't work with Stryker despite following the clear and useful instructions in "Getting started".
The text was updated successfully, but these errors were encountered: