Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install package with stable version but prerelease dependencies #2944

Closed
skofman1 opened this issue Jun 9, 2016 · 10 comments
Closed

Comments

@skofman1
Copy link
Contributor

skofman1 commented Jun 9, 2016

Repro steps:

  1. Create a package with prerelease dependencies using project.json and dotnet pack
  2. Place the package in a folder and configure VS to use this folder as a local repository
  3. Create a project with packages.config. Using package manager console/UI add the package to the project.

Error (for example):
Unable to find a version of 'NuGet.Protocol.Core.v3' that is compatible with 'NuGet.Client.Staging 1.0.0 constraint: NuGet.Protocol.Core.v3 (>= 3.5.0-beta-final)'.

@rrelyea
Copy link
Contributor

rrelyea commented Jun 10, 2016

sounds like a bug in dotnet pack. I think we shouldn't let you build a "final" version of a package if it has prerelease dependencies.

@emgarten
Copy link
Member

This is fixed for PackageReference. We should determine if we want to fix this for packages.config, or leave it as is.

@nicbavetta
Copy link

@emgarten What needs to be added to PackageReference to get this to work?

@emgarten
Copy link
Member

@nicbavetta with PackageReference it works by default. To find out more on converting take a look at https://blog.nuget.org/20170316/NuGet-now-fully-integrated-into-MSBuild.html

@hamjo
Copy link

hamjo commented Oct 4, 2018

Any update on the status?

@WojciechNagorski
Copy link

Any update?
This problem blocks me in two new features of BenchmarkDotNet.

I would like to use Microsoft.Diagnostics.NETCore.Client:
dotnet/BenchmarkDotNet#1315
and System.CommandLine:
dotnet/BenchmarkDotNet#1037

All interested: @AndreyAkinshin @adamsitnik @sywhang @jonsequitur

@adamsitnik
Copy link

@rrelyea any update on this? It's blocking us in BenchmarkDotNet

@rrelyea
Copy link
Contributor

rrelyea commented Dec 9, 2019

If this is blocking you, please be specific of which scenario is broken... it sounds like a few new issues got spun off this one.

Are you using packages.config? Do you have unique version upper bounds declared, etc...

@adamsitnik
Copy link

If this is blocking you, please be specific of which scenario is broken... it sounds like a few new issues got spun off this one.

@rrelyea sure!

  1. Create a new .NET Standard library
  2. Add a dependency to a preview package. System.CommandLine.Experimental is a good example
  3. Create a NuGet package using dotnet pack
  4. Publish the package to some nuget feed
  5. Create a new Full .NET Framework Console App using Visual Studio 2017|2019
  6. Try to install the new NuGet package (the app must be using packages.config file)
  7. It fails with Unable to resolve dependency error
    `

Example:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="System.CommandLine.Experimental" Version="0.3.0-alpha.19577.1" />
  </ItemGroup>
</Project>
dotnet pack -c Release

I've published it to NuGet.org: https://www.nuget.org/packages/net_std_lib/ and tried to install in .NET 4.6.1 app using Visual Studio 2017 and 2019 with include prerelease unchecked

VS 2017

obraz

VS 2019

obraz

@aortiz-msft
Copy link
Contributor

Thank you for your feedback. We appreciate you letting us know about the problem. Based on input from the community, this is currently low priority for us. We will look at this again if the issue is upvoted by the community. Also, we recommend moving from packages.config to PackageReference if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants