Nuget errors building your UWP with .NET Core 5.2.2 in VSTS hosted build

For most of my projects i am using a build server so my team members and me are sure we have a working project and are not blocking eachother with new changes. For our current UWP projects started to use the final .net core version (5.2.2). But since we are doing that we had errors on our build server, the hosted VSTS build server. The build summary shows this:

builderrors

You see that nuget gives errors that Microsoft.NETCore.Targets 1.0.2 is not compatible with UAP,Version=v10.0.

Initially i not really could understand this error, since VS2015 update 3 is available on the hosted build server, which include the latest nuget version.

After checking with some people from Microsoft on twitter I figured out that they are not using the nuget version that comes with Visual Studio but have it separately installed, and because compatiblity issues with 3.4 they chosed to deploy nuget 3.3. .NET Core required at least 3.4 version. You can check the conversation about the nuget version here: https://twitter.com/davesmits/status/755068963722264576

Solving this issues is lucky not that hard. The nuget build tasks let you specify your own nuget.exe.

So first you have to add your own nuget.exe to source control. I created a folder tools for this in my repository and added nuget.exe to this folder.

git

After adding nuget.exe to the git repository just had to specify the nuget.exe in my restore task. You can do this under the "Advanced" group

specify nuget.exe

It's important that specify the full path including the "$(Build.SourcesDirectory)". I tried without and the build task was unable to find nuget.exe

Now when using the right nuget version you can build your UWP projects again in the VSTS hosted build server

  •   @JenMsft never mind; i found it by going to the old control panel; made a feedback item for it https://t.co/WmouYyriYV
  •   @peterskillman need help testing? :)
  •   @JenMsft i had to reset windows (recovery in the settings app) on my surface book 2 in order to be able to get a fi… https://t.co/0oTMC6nvpb
  •   RT @WBuzzer: Microsoft and Amazon Finally Launch Cortana and Alexa Integration https://t.co/8yJ1ijZRoU https://t.co/K24wtKFkSA
  •   @tfsbuck @thomsen_digital @cschleiden @matthewisabel +1 extension builders need guidiness for this. and what is the… https://t.co/3Ecj7tEkPG
  •   RT @rajen_k: Visual Studio 2017 version 15.8 is now available for download! Check out the details at https://t.co/G23ibMjjfY #VisualStudio
  •   @ingnl laatste windows 10; en ook op laatste insider build geprobeerd maar niet veel beter; Dus terug naar de vraag… https://t.co/zK70bdkiaM
  •   @Rabobank doe ik het voor jullie; gister de website omgezet :)
  •   @Rabobank nee gewoon voor mijn laptop
  •   @Rabobank een app? of zal ik mijn versie maar publiseren? https://t.co/ooJT7dJFQP