Coruscate5
Coruscate5

Reputation: 2533

NuGet Package Restore fails with error message - can't build solution

I recently ran into an issue with an old Visual Studio solution/project where I couldn't build the solution because NuGet was reporting the following:

"Unable to find version '0.1.0' of package 'ElmahJS' on <NuGet feed>..."

How can I resolve this issue?

Upvotes: 0

Views: 498

Answers (2)

Pranay Rana
Pranay Rana

Reputation: 176886

seems like your pakage is no loge exists you can update your package from package manager console using following command

# Updates a specific package using its identifier, in this case ElmahJS
Update-Package ElmahJS

if above dont work than try

# Uninstalls the Elmah package and all its unused dependencies
Uninstall-Package Elmah -RemoveDependencies 

# Add the Elmah package to the default project as specified in the console's project selector
Install-Package Elmah

for details check here : https://learn.microsoft.com/en-us/nuget/tools/package-manager-console#updating-a-package

Upvotes: 0

Coruscate5
Coruscate5

Reputation: 2533

For older projects, I've found that this error may actually mean what it says - the Nuget package no longer exists on Nuget.

In some cases, the package reference you need may already exist in the solution - i.e. the package restore is not necessary to restore the reference needed.

In that case, open the packages.config file in the root of the project, and comment out the line(s) with the problematic packages.

If the NuGet package doesn't exist AND the corresponding reference doesn't exist in the checked-in solution, then you may have to go on a hunt outside of Nuget to find if the package still exists (i.e. Google).

If it no longer exists anywhere, replace with a suitable alternative.

Upvotes: 1

Related Questions