1

I upgraded my Nuget version on my UWP automated build from V3.5.0 to V4.0.0

After doing so my UWP build I got the following error:

error : Your project is not referencing the "UAP,Version=v10.0.10240" framework. Add a reference to "UAP,Version=v10.0.10240" in the "frameworks" section of your project.json, and then re-run NuGet restore.

I'm not sure how to add a reference to that UAP,Version=v10.0.10240 in my project.json

My project.json file looks like so:

{
  "dependencies": {
    "Microsoft.NETCore.UniversalWindowsPlatform": "5.3.3",
    "Xamarin.Forms": "2.3.4.247"
  },
  "frameworks": {
    "uap10.0": {}
  },
  "runtimes": {
    "win10-arm": {},
    "win10-arm-aot": {},
    "win10-x86": {},
    "win10-x86-aot": {},
    "win10-x64": {},
    "win10-x64-aot": {}
  }
}

I would have presumed that the uap.10.0 was sufficient.

Is there another framework I need to add?

JKennedy
  • 18,150
  • 17
  • 114
  • 198
  • Try to use[nuget 4.1](https://dist.nuget.org/index.html) and check the result (Specify NuGet.exe in Nuget task 0.*). Related issue: https://github.com/NuGet/Home/issues/4532 and https://github.com/NuGet/Home/issues/4515 – starian chen-MSFT Aug 03 '17 at 08:46
  • @starain-MSFT I tried installing the [Nuget.CommandLine Nuget](https://www.nuget.org/packages/NuGet.CommandLine/) and then specifying the path to that, but then realised using a `Nuget` package to run `Nuget` probably isnt going to work. Have you got a way of installing `Nuget 4.1`? Currently the VSTS task only goes up to `4.0.0` – JKennedy Aug 03 '17 at 09:30
  • `Nuget 3.5.0` had an error where I needed `msbuild 12` installed hence why I upgraded – JKennedy Aug 03 '17 at 09:31
  • I actually ended up installing `VS2015` and downgrading to `3.5.0` if you've got any good solutions to using a custom nuget version let me know and I'll try it out. Obviously if you are using a cloud vm you wont be lucky enough to have access – JKennedy Aug 03 '17 at 12:00
  • 1. Download nuget 4.1 2. Add it to source control or share folder 3. Add Nuget task 4. Change 2.* to 0.* 5. Expand Advance section 6. Specify NuGet.exe path – starian chen-MSFT Aug 04 '17 at 01:29
  • On the other hand, is it a Visual Studio 2015 project? Could you reproduce this issue with a new project? – starian chen-MSFT Aug 04 '17 at 01:32
  • There is NuGet Tool Installer task in Tool category, you can add it before NuGet restore task. The Universal Windows Platform build template uses it. (create build definition=> Select Universal Windows Platform template). On the other hand, I can't reproduce this issue with UWP app (created via vs 2015), can you share a simple project on the OneDrive? – starian chen-MSFT Aug 04 '17 at 06:23

1 Answers1

2

In my case I've solved running restore from Visual Studio Command Prompt:

msbuild /t:restore path-to-solution-file.sln
christian mini
  • 1,662
  • 20
  • 39