question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for arbitrary Nuget versions in Nuget installer package

See original GitHub issue

The 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:17 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dasMullicommented, Sep 20, 2017

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:

Write-Host ("##vso[task.setvariable variable=NuGetExeToolPath]" + $path)
1reaction
henning-krausecommented, Sep 20, 2017

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 }

Read more comments on GitHub >

github_iconTop Results From Across the Web

NuGet Package Dependency Resolution - Microsoft Learn
Details on the process through which a NuGet package's dependencies are resolved and installed in both NuGet 2.x and NuGet 3.x+.
Read more >
nuget spec dependencies, get latest version? - Stack Overflow
To get the latest version of the psake NuGet package you would need to install it using the Package Manager console, or the...
Read more >
NuGet Installer | TeamCity On-Premises Documentation
The NuGet Installer build runner performs NuGet Command-line package restore. It can also (optionally) automatically update package ...
Read more >
augustoproiete/i-am-root-nuget-package - GitHub
This project demonstrates that any NuGet package can run arbitrary code on your machine. ... TL;DR; Installing NuGet packages is (and have always...
Read more >
CliWrap 3.6.0 - NuGet
dotnet add package CliWrap --version 3.6.0. NuGet\Install-Package ... To learn more about the war and how you can help, click here. Glory to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found