Search code examples
visual-studionugetnuget-packagenuget-package-restore

An error occurred while trying to restore packages. Unable to find version 'x.x.xxxx.xxx' of Moq


I am getting an below error while trying to install package 'xxx' on a project through visual studio using manage nuget packages

An error occurred while trying to restore packages. Unable to find version 'x.x.xxxx.xxx' of Moq. Package 'Moq x.x.xxxx.xxx' is not found on source.

I am getting an this error while trying to install package 'xxx'. Trying to restore failed with the same error I tried nuget locals all -clear and reopening vs. But nothing worked.


Solution

  • From the issue, the problem show that the source doesn't have specific version needed in the source.

    This could occurred by the source doesn't have the specific version.

    So please add the source which has the specific version.

    For example, you could add the official nuget package source:

    https://api.nuget.org/v3/index.json

    enter image description here