The Issue
This article will help you resolve a nuget issue that involves packages which have case-sensitive misspellings in their dependency lists. Here is a sample error message:
Install-Package : Unable to resolve dependency 'Microsoft.Extensions.COnfiguration.Builder'
The Conditions
This is a very specific scenario. So, it takes a couple of preconditions to create:
- You have to have attempted installing the nuget package into a project.
- And, the installation had to fail with the above message. Here’s a screen shot for more context.
- The installation needs to leave your system with the metadata for the package downloaded, but the actual .nupkg is no where on disk.
The Solution
In this scenario, your package metadata cache (called the http-cache) has been updated with the packages dependency list. So, the next time you attempt to call nuget.exe; instead of fetching a fresh copy of the packages metadata from the source, it will use the cached version. To fix this, we’ll need to remove the cached metadata.
- Find the package metadata store on your computer (reference docs):
nuget locals all –list
- Use the http-cache value provided, and open the folder in file explorer. And, then find the subfolder which matches the package source.
- Within the subfolder, find the package you’re looking for and delete it.
- Now, you are ready to reinstall the package from nuget using the latest metadata information.
0 comments:
Post a Comment