Problem
Whilst recently installing Specflow on a new Windows PC, I ran into an unexpected error after running the below command:
dotnet tool install --global SpecFlow.Plus.License --version 3.9.7
This is the error I encountered whilst running the above command:
C:\Users\XXXX\AppData\Local\Temp\cd1e38b3-c92a-436d-b439-f1535d848adc\restore.csproj : error NU1101: Unable to find package specflow.plus.license. No packages exist with this id in source(s): C:\Program Files\dotnet\library-packs, Microsoft Visual Studio Offline Packages The tool package could not be restored.
Tool ‘specflow.plus.license’ 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.
For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool
Solution
Well, it turns out that the ‘nuget.org’ NuGet package feed source was missing on my local machine. So the solution was to simply add this back in, as follows. After doing so, the issue was resolved when re-running the above SpecFlow installation command.
1. Open Visual Studio
2. Navigate to TOOLS > OPTIONS
3. Navigate to NUGET PACKAGE MANAGER > PACKAGE SOURCES
4. Add the missing ‘nuget.org’ package feed as per below:
- Name: nuget.org
- Source: https://api.nuget.org/v3/index.json
Final Thoughts
Well, I hope this solution has helped to resolve the ‘Unable to find package specflow.plus.license’ error for you. If you find any alternative solutions, then feel free to post them in the comments below.
Happy coding 🙂
Leave a Reply