-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TargetFramework cannot be set in Directory.Build.props #3144
Comments
Thanks for raising this issue. We will look into it. Note that the issue may likely be within the Buildalyzer package Stryker uses for project analysis. |
@dupdob Yes, that's exactly the issue. The |
Not sure what's going on here because we use this ourselves in Stryker: https://github.com/stryker-mutator/stryker-net/blob/master/src/Directory.Build.props#L4 |
Perhaps |
Note that current Stryker releases do not support top-level statements.... |
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: