Unable to install Dotnet Stryker

476 views Asked by At

I have tried the below commands to install dotnet stryker to my project to improve the mutation testing but getting below error message and it does not allow me to install the tool. Could you please help on this.

Thanks in advance

PS C:\Users> dotnet tool install -g dotnet-stryker
C:\Program Files\dotnet\sdk\6.0.101\NuGet.targets(130,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [C:\Users\AppData\Local\Temp\evv2az1v.kwa\restore.csproj]
C:\Program Files\dotnet\sdk\6.0.101\NuGet.targets(130,5): error :   A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (api.nuget.org:443) [C:\Users\AppData\Local\Temp\evv2az1v.kwa\restore.csproj]
C:\Program Files\dotnet\sdk\6.0.101\NuGet.targets(130,5): error :   A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. [C:\Users\AppData\Local\Temp\evv2az1v.kwa\restore.csproj]
The tool package could not be restored.
Tool 'dotnet-stryker' failed to install. This failure may have been caused by:

* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.

Below commands are also getting the same error message

PS C:\Users> dotnet tool install -g dotnet-stryker dotnet tool install --global dotnet-stryker --version 1.0.0

1

There are 1 answers

0
psfinaki On

This is most probably not related to Stryker but to some weird NuGet situation. You can check it by installing some common tool, e.g dotnet-reportgenerator-globaltool. I think I have seen this kind of error when setting up local feeds for dev purposes.

So try this:

  1. dotnet nuget list source - list feeds
  2. dotnet nuget remove source <feed_name> - remove everything you don't need or understand

And then try installing Stryker once again.