Codev
Codev

Reputation: 43

Nuget package manager failed for project, Unable to find version 5.2.6 of package ‘Microsoft.AspNet.Mvc

I try to set up an application but I am facing the below error:

Nuget package restore failed for project ProjectName: Unable to find version ‘5.2.6’ of package ‘Microsoft.AspNet.Mvc’. C:/Program Files (x86)\Microsoft SDKs\NugetPackages: Package ‘Microsoft.AspNet.Mvc.5.2.6’ is not found on source ‘c:\Program files (x86)\Microsoft SDKs\NugetPackages\’. http://ncrsdk-lib.ncrcorp******** : Package ‘Microsoft.AspNet.Mvc.5.2.6’ is not found on source ‘http://ncrsdk-lib.ncrcorp.net/********’*

I tried to run the following command in the package manager console:

PM> Install-Package Microsoft.AspNet.Mvc -Version 5.2.6

I got the error some packages are missing from the solution. The package needs to be restored In order to build the dependency graph.

I clicked on the restore packages button and that gives a message unable to restore.

Upvotes: 0

Views: 3285

Answers (3)

Chandra Prakash Ajmera
Chandra Prakash Ajmera

Reputation: 304

From the error message looks like you are looking for a version that no longer exists and cannot tell which Package source you have selected. Its trying to download the package form "http://ncrsdk-lib.ncrcorp********" where as the package may be removed from there. Try installing the the same package from source nuget.org only.

Upvotes: 0

Codev
Codev

Reputation: 43

I cleared the package cache and added nuget.org to the package sources(was missing before) , This fixed the issue.

Source - An error occurred while trying to restore packages. Please try again

Upvotes: 1

Houssem
Houssem

Reputation: 1072

The package does not exist in the mentioned source , try to point your source to official nuget.org website , you have to options in order to force it to point to the correct one

Command Line

Install-Package Microsoft.AspNet.Mvc -Version 5.2.6 -Source https://api.nuget.org/v3/index.json

Or from Visual Studio you can select the correct source or configure a new source to point the official nuget.org enter image description here

Upvotes: 0

Related Questions