Stryker is installed using the dotnet cli as a dotnet tool
Stryker requires the dotnet 6.0 runtime or newer: Install dotnet
* Note: Your application does not need to target dotnet 6.0 or newer. You only need the runtime installed so stryker can run.
Dotnet framework specific
Nuget is required for dotnet framework. Follow the instructions at Install nuget including adding nuget to the path. Otherwise stryker will not be able to find and use nuget.
Make sure NuGet targets and build tasks are installed. You can install them with visual studio by going to Tools > Get Tools and Features > Individual components > Code tools
NuGet targets and build tasks feature
Coming from Stryker.NET V0.x? Take a look at our migration guide.
Stryker can be installed globally for your whole system or locally for a specific project.
dotnet tool install -g dotnet-stryker
Install in project
Create a file called dotnet-tools.json in your project folder if this is your first local tool.
dotnet new tool-manifest
Then install stryker without the -g flag by executing the following command in the project folder
dotnet tool install dotnet-stryker
dotnet-tools.json file into source control
Now the rest of your team can install or update stryker with the following command:
dotnet tool restore
Make sure the working directory for your console is set to the unit test project dir.
Let's kill some mutants
For most projects no configuration is needed. Simply run stryker and it will find your source project to mutate.
If more configuration is needed follow the instructions in your console.
Optionally you can add a config file to store your options so they won't have to be passed using CLI each run.
Do this by adding a
stryker-config.json file to your run location. Now add your config to the file like this:
For all available configuration see our configuration page.
Have troubles running Stryker? Try running with trace logging.
dotnet stryker --verbosity trace --log-to-file
Please report any issues you have or let us know via Slack.