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

PackageReference with a star in version is displayed under the updates tab/incorrectly represented in the installed tab #3788

Closed
emgarten opened this issue Oct 27, 2016 · 30 comments

Comments

@emgarten
Copy link
Member

emgarten commented Oct 27, 2016

Steps

  1. File > New Project > NETCore console app
  2. Add a package reference with a star
  3. Open the NuGet UI and go to the installed tab

Expected

No updates displayed, and the correct package info is shown

Actual

An update is displayed and no package info

    <PackageReference Include="Newtonsoft.Json">
      <Version>9.0.*</Version>
    </PackageReference>

capture

Another customer report:
https://developercommunity.visualstudio.com/content/problem/277887/nuget-package-manager-doesnt-respect-package-refer.html

Another scenario: #3101

[SPEC]
https://github.com/NuGet/Home/wiki/%5BSpec%5D-NuGet-Build-Integrated-Project-handling-of-floating-versions-and-ranges-in-Visual-Studio-Client

@hkoelewijn
Copy link

It would be nice if VS allowed you to specify wildcards in the package manager in stead of us having to open the proj file directly

@emgarten emgarten modified the milestones: 4.4, Backlog Oct 3, 2017
@jainaashish jainaashish added the Priority:2 Issues for the current backlog. label Nov 9, 2017
@pmiossec
Copy link

I think that's linked but when, in the "Package Manager Console", when you list the packages installed (with Get-Package command), you get the last number at "0".

Example:
For: <PackageReference Include="Newtonsoft.Json" Version="9.0.*" />
you will always get (even if 9.0.3 is really installed) : Newtonsoft.Json {9.0.0}

That's surely why "Nuget Package Manager` see it as "Should be updated"...

Is there some update on this issue? Seems to be postponed since v4.0... 😢

@Neme12
Copy link

Neme12 commented Nov 8, 2018

I found this after searching and trying out different things for 20 minutes thinking I must be doing something wrong with the wildcard 😕

@tobiasschulz
Copy link

Yeah I really don't get why this has not been fixed yet.

@rfcdejong
Copy link

Any ETA?

@pmiossec
Copy link

That's the type of issue, that completely prevent the use of wildcard (I had to fallback to hardcoded version 😢 ) and so to put in place an update strategy that let me think that the paket ( https://github.com/fsprojects/Paket ) community driven project is a lot better solution to manage dependencies in a .net project....

That's a shame that the nuget team don't borrow most of the excellent ideas brought by this solution to spread them to the all the .net developers and make nuget a correct dependency manager 😢

@PatoBeltran PatoBeltran removed their assignment Jan 31, 2019
@donnie-msft donnie-msft added this to the Sprint 183 - 2021.02.01 milestone Feb 1, 2021
@donnie-msft donnie-msft removed their assignment Feb 19, 2021
@donnie-msft donnie-msft removed this from the Sprint 2021-02 milestone Feb 19, 2021
@harigutta
Copy link

Any updates on this issue?

@aschuhardt
Copy link

This is still very relevant and a major pain point for many of us, I'm sure.

@Sl1ckR1ck
Copy link

Any update on this? Basically we can't use floating version at all?

Why is it still listed as a feature in the documentations?

@nkolev92
Copy link
Member

nkolev92 commented Jan 3, 2022

@Sl1ckR1ck

You can use floating versions, it's just the package manager UI that doesn't show you the floating versions are being used.

@tobiasschulz
Copy link

Yeah, but whyyy not?

Also the UI breaks / removes the floating versions if you use it.
It should at least leave those alone when updating packages. That would be the least they could do.

@websitewill
Copy link

Yeah, but whyyy not?

Also the UI breaks / removes the floating versions if you use it. It should at least leave those alone when updating packages. That would be the least they could do.

100% agree. Just ran into this and spent time trying to figure out what I was doing wrong...

@Sl1ckR1ck
Copy link

Yes, as soon as you update using the package manager, it replaces the floating version with the fixed version.

I would understand this logic if the package was replaced with a version that doesn't match the floating version pattern...

I am using the floating version to provide our CI pipeline with some automation that ensure that all the latest components of our software package are building well together and run some automated tests.

@nkolev92
Copy link
Member

Hey all,
This will be available in 17.3.

You will be able to install custom versions, and packages that resolve to latest via a floating version won't be shown in the updates tab.

Note that you can still clobber the user specified version if you install an exact version of a package. You can track that in #6566.

installing-floating-versions
floating-versions

cc @martinrrm

@nkolev92 nkolev92 assigned nkolev92 and martinrrm and unassigned nkolev92 Jul 29, 2022
@nkolev92 nkolev92 added this to the 6.3 milestone Jul 29, 2022
@PandeleFlorin
Copy link

Great. After How many YEARS was this solved? I don't even use VS/nugget any more...

@uhfath
Copy link

uhfath commented Nov 9, 2022

Is this really works?
This is what I get on VS 17.4:
image
image
Tried numerous combinations defined in docs
In the end I either get that my version installed is 1.x.x or even 0.0.0.
And when the UI always shows there is an update available. And after updating it replaces my wildcards with a specific version updated.

@nkolev92
Copy link
Member

nkolev92 commented Nov 9, 2022

And when the UI always shows there is an update available. And after updating it replaces my wildcards with a specific version updated.

You can type a version to update to manually. When you click installing 7.0.0, it thinks you want to install 7.0.0.

The free form version entering is only available in the project level UI.

@uhfath
Copy link

uhfath commented Nov 10, 2022

And when the UI always shows there is an update available. And after updating it replaces my wildcards with a specific version updated.

You can type a version to update to manually. When you click installing 7.0.0, it thinks you want to install 7.0.0.

The free form version entering is only available in the project level UI.

The problem is that I don't click "install". I click "update" which implicitly works like an install. But there is no other way through UI except picking the version manually for each project.
Work the same way per-project or per-solution.

@martinrrm
Copy link
Contributor

martinrrm commented Nov 10, 2022

@uhfath Hi! Using floating versions in the PM UI is only available for project level at the moment. Updating/Installing to a version using the versions combobox will override what you have in your project file. In your screenshot your version is 6.* which will not cover the version 7.0.0 which is the latest and is why is suggesting you an update. If you always want the latest version, I suggest using * instead.

@uhfath
Copy link

uhfath commented Nov 11, 2022

@martinrrm Thanks for the info.
Actually in our case we want to keep 6.* versions and not transition to major 7.x until we ready.
I tried to use version range notation like (,7.0) or [6.0,7.0) or event [6.0] but the results were always the same. There are always 'updates' available to 7.0 and after pressing 'update' they all overwrite.
Is using version ranges supported for solution or project level?
Is there any working method to keep major version without changes and use solution or project level updating?

@Zastai
Copy link

Zastai commented Nov 11, 2022

It's a bit of a hack, but you can add IsImplicitlyDefined="true" to a PackageReference. That tells the package manager that it comes from an SDK, which I think stops it from offering upgrades for it. However, it may also hide it entirely; not sure now (and can't currently check).

@uhfath
Copy link

uhfath commented Nov 11, 2022

@Zastai yep. It becomes hidden entirely even though there is an update to the minor version.
Just checked like this:
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" IsImplicitlyDefined="true" Version="6.0.10" />
There is an update to 6.0.11 which I wanted to apply but using this attribute the entire package is hidden.

@davide-bergamini-sevenit

This problem is still present

@fedordavid
Copy link

I'm facing this problem still and very unconvenient

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