1

I am trying to build Windows Calculator (Microsoft/Calculator on GitHub) with Visual Studio 2017 Community version. I followed the instructions but got an error message starting with:

NuGet Package restore failed for project Calculator: Unable to find version '1.0.2' of package 'Microsoft.WindowsCalculator.PGO'.
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\: Package 'Microsoft.WindowsCalculator.PGO.1.0.2' is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'.
https://api.nuget.org/v3/index.json: Package 'Microsoft.WindowsCalculator.PGO.1.0.2' is not found on source 'https://api.nuget.org/v3/index.json'.
Please see Error List window for detailed warnings and errors.
(......build started and failed)

I checked nuget.config found in the repo and it mentions https://eeapps.blob.core.windows.net/eeapps/index.json, which did not appear in the error message. It seems to me that nuget failed to check this location for packages. How do I restore the missing packages?

Tony Beta Lambda
  • 529
  • 3
  • 18

2 Answers2

0

NuGet package restore failed when building Windows Calculator

To resolve this issue, you should add the specify nuget source (https://eeapps.blob.core.windows.net/eeapps/index.json) to the Package Source in the Visual Studio:

Tools->Options->NuGet Package Management->Package Source:

enter image description here

Then you can see those packages:

enter image description here

Now, you can restore the nuget packages with the options Restore NuGet Packages when you right click on your solution file.

Hope this helps.

Community
  • 1
  • 1
Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • The "restore failed" message disappears but I am still getting "this project references nuget packages that are missing on this computer" error. – Tony Beta Lambda Mar 13 '19 at 03:54
0

After some research I realized the problem actually has nothing to do with NuGet.

I cloned the repo with git on WSL (Ubuntu app), and after reading this answer I retried cloning with Git on Windows and the problem simply disappears.

It seems that git clone on WSL and Visual Studio just don't get along. Related GitHub issue here.

Tony Beta Lambda
  • 529
  • 3
  • 18