Support for arbitrary Nuget versions in Nuget installer package
See original GitHub issueThe version 0.x of the task allows a user to select an arbitrary nuget.exe which it should use to restore the packages.
It would be nice to have this option in the current version as well.
Reason: I’ve just converted a package of ours to a netstandard2.0 assembly and published it to our TFS nuget feed. Then I added it as a <PackageReference> to a couple of projects which target .Net 4.6.2. In the next build, the nuget restore fails with this error message:
Package MyPackage 12.1.10 is not compatible with net462 (.NETFramework,Version=v4.6.2). Package MyPackage 12.1.10 supports: netstandard2.0 (.NETStandard,Version=v2.0)
2017-08-24T11:21:39.8123608Z One or more packages are incompatible with .NETFramework,Version=v4.6.2.
The tasks currently uses Nuget 4.0 to restore the packages. And indeed, if I use that version to restore the package on my development computer, I get the same error. But Nuget 4.3 can cope with this situation quite well.
Now I was forced to downgrade to the 0.x version of the task which let me specify the nuget.exe. But I loose cool feature of the 1.x version: Specify the private Nuget feed.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:17 (5 by maintainers)
Turns out I can also use the 1.* task when I add this to your script to set the variable that the new NuGet tasks use:
I just added a download task for nuget as a first step in my pipeline using an inline PowerShell task:
$path = (Get-Content Env:BUILD_REPOSITORY_LOCALPATH) + “\nuget.exe” if (!(Test-Path $path)) { iwr https://dist.nuget.org/win-x86-commandline/v4.3.0/nuget.exe -OutFile $path }