NU1102: Unable to find package Microsoft.Windows.SDK.BuildTools with version (>= 10.0.19041.8) - azure-devops

In my build pipeline, I have the following step:
I am getting the following error:
##[error]The nuget command failed with exit code(1) and error(NU1102: Unable to find package Microsoft.Windows.SDK.BuildTools with version (>= 10.0.19041.8)
When I go to the NuGet page for this package: Microsoft.Windows.SDK.BuildTools, I see that it only has one version: 10.0.18362.3-preview. I am not sure why the NuGet restore step is trying to get a higher version that does not exist. Why is this happening and how can I fix it? Note: this is my first Pipeline.
Agent Specification: Windows-2019.

From this page, you can see only two versions of the package Microsoft.Windows.SDK.BuildTools are listed:
10.0.19041.1
10.0.18362.3-preview
When open the page of version 10.0.19041.1, you can see the warning message to notify that this package version has been deprecated. But it seems that you can still download and install it.
I think the other package versions may have been permanently deleted by the owner due to some security vulnerabilities. So you no longer find them.
You can try to open your project using Visual Studio on your local machine, and change to use version 10.0.18362.3-preview in your program.

Related

Visual Studio 2019 Nuget cannot find a package

My packages.config has this entry:
<package id="xxxxxx" version="3.0.0" allowedVersions="[3.0,3.3)" targetFramework="net452">
Now there is no package xxxxxxx at version 3.0.0 (there might have been, once upon a time), but I am allowing anything between 3.0 and 3.3. I do have a package at 3.1.0, and I expected that nuget would find that one and pick it up, but I get the error
Unable to find version '3.0.0' of package xxxxxxxx
Questions:
Why does nuget not say, "oh I can't find 3.0.0 but I'm allowed to use anything from 3.0 to 3.3 and I have 3.1.0. I'll use that!"
What is the correct config to use to make it pick up the highest available version in the allowed range?
In packages.config, every dependency is listed with an exact
version attribute that's used when restoring packages. The
allowedVersions attribute is used only during update operations to
constrain the versions to which the package might be updated.
Source: https://learn.microsoft.com/en-us/nuget/concepts/package-versioning#references-in-project-files-packagereference
If you want to use ranges in your project, you will have to switch to References in project files (PackageReference), but keep in mind:
NuGet 2.8.x and earlier chooses the latest available package version
when resolving a dependency, whereas NuGet 3.x and later chooses the
lowest package version.
Option to always resolve to highest version was proposed and rejected: https://github.com/NuGet/Home/issues/1192

Unable to resolve dependencies. 'xxx' is not compatible with 'yyy constraint: zzz)'

We have a project that is utilizing a set of Nuget-based Azure libraries. One of them was published with a specific MIN and MAX dependency on Newtonsoft.Json (max version being 7)
This was a headache, because other libraries depend on 8+ version of Netwon and this specific Azure library is just fine working with any modern Json package.
In VS2013, we forced to install this Azure library with newer version of Json package thru nuget installer and subsequently, Nuget never gave us any issues installing/updating other libraries.
However, after upgrading to VS2017, we cannot update any package (or at least the ones that depend on Json) and we get the error below.
Unable to resolve dependencies. 'Newtonsoft.Json 8.0.3' is not compatible with 'Microsoft.Azure.Insights 0.15.0-preview constraint: Newtonsoft.Json (>= 6.0.8 && < 7.0.0)'
How do we have Nuget ignore that specific Azure library's unimportant MAX version dependence?
How do we have Nuget ignore that specific Azure library's unimportant MAX version dependence?
If you confirm that Azure library is just fine working with any modern Json package and you want use the Microsoft.Azure.Insights 0.15.0-preview and 8+ version of Newtonsoft.Json at the same time. I would like provide a workaround to you, hope this can help you.
Detailed Steps:
Install the package Microsoft.Azure.Insights 0.15.0-preview with its dependencies first.
Only uninstall the package Microsoft.Azure.Insights 0.15.0-preview, Keep dependencies installed.
Update the Newtonsoft.Json to the version 8+.
Install the package Microsoft.Azure.Insights 0.15.0-preview in the Package Manager Console with following NuGet command:
Install-package Microsoft.Azure.Insights -IncludePrerelease -IgnoreDependencies
With the option -IgnoreDependencies, NuGet will ignore that specific Azure library's unimportant MAX version dependence:
Note: Need to mention is that if you update the Newtonsoft.Json package next time, you still need to follow the steps above to upgrade your Newtonsoft.Json package.

NuGet restore works if old version 0.*, but fails with version 2.*

I've got a VSTS build, starting from a blank, originally with just Node.js bits, but now adding some C# bits.
Added the NuGet restore, build sln and vstest tasks as part of the update to the build.
Build fails on the NuGet restore task with the error around the MSTest TestAdapter ...
Restoring NuGet package MSTest.TestAdapter.1.1.11.
Restoring NuGet package MSTest.TestFramework.1.1.11.
WARNING: Unable to find version '1.1.11' of package 'MSTest.TestFramework'.
WARNING: Unable to find version '1.1.11' of package 'MSTest.TestAdapter'.
Errors in packages.config projects
Unable to find version '1.1.11' of package 'MSTest.TestFramework'.
Unable to find version '1.1.11' of package 'MSTest.TestAdapter'.
Why doesn't it pick up the MSTest package?
And even more puzzling to me ??? ...
I spotted the task was version 2.*
tried setting it to version 0.* ...
and the build works !! ... runs tests, etc.
Why does version 0.* work, yet the latest version 2.* fails?

Cannot install FsLab with NuGet

Complete VS noob. Fresh install of Visual Studio Community 2015. New project. Trying to install FsLab with NuGet ends with this error:
Unable to find a version of 'Deedle' that is compatible with 'FsLab 1.0.2 constraint: Deedle (= 1.2.5)'
When I search for Deedle the version that NuGet shows is v1.2.5.
I suspect this is a NuGet problem after reading about some issues with its dependency resolution management.
I tried installing Deedle separately and setting NuGet's Dependency behavior to Highest with no luck. In the end I installed Paket which worked with no problems. No time to debug this further for now.

Nuget "Older to New" Update Failed

I want to update project for Asp.NET Web Api 2.2 (My project is Web Api 1.0). But Nuget doesn't update all package and i didn't find this problem's solve.
Can you help me for this problem ?
Failed Text:
Updating 'Microsoft.AspNet.WebApi.Core 4.0.30506.0' to 'Microsoft.AspNet.WebApi.Core 5.2.0' failed. Unable to find a version of 'Strathweb.CacheOutput' that is compatible with 'Microsoft.AspNet.WebApi.Core 5.2.0'.
It looks like the current build of Strathweb.CacheOutput (0.5.0) package is fixed to WebApi 4.0.30506.
You have 2 options:
Contact the package owner and ask them to allow the package to work with newer versions of WebApi
Use the command line for NuGet in Visual Studio to force the package update by specifying the -IgnoreDependencies argument
Either way, you will need a binding redirect for Microsoft.AspNet.WebApi.Core 4.0.30506.0 -> 5.2.0, depending on which option you use, NuGet may add this to your web.config for you.