You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Version ranges are not preserved when upgrading packages #388
Create a new project with a reference to a package that
a. has a minor or patch upgrade
b. specifies a version range, e.g. <PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="[6.0.13,7)" />
Run the upgrade command, e.g. dotnet-outdated --version-lock Major --upgrade
EXPECTED RESULT
The specified version range is preserved, i.e. the resulting reference should be <PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="[6.0.14,7)" />
ACTUAL RESULT
Version ranges are removed, i.e. the resulting reference is <PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="6.0.14" />
Reacted by Vincent Biret, jcdcdev, Vincent, Dylan Barnett, Frulfump, Marc, Julian Verdurmen and S-Luiten
Preferrably, version ranges would also be respected. This would effectively remove the need for the --version-lock switch and solve issues like #106 ? But that probably requires a lot more work.
This happens with both variants of running dotnet outdated
- task: PowerShell@2displayName: Run Dotnet outdatedinputs:
targetType: "inline"script: | dotnet outdated -inc Umbraco. -vl Major -u
- task: DotNetCoreCLI@2displayName: "Update Umbraco CMS"inputs:
command: "custom"custom: "outdated"arguments: "-inc Umbraco. --version-lock Major -u"
The version lock does not seem to work. But its pretty weird since on my local installation I use the exact same version of the tool as in my pipeline runner
I've been hoping for a solution to this problem for a long time. The current behavior (both of Visual Studio's NuGet Solution Update and the command-line tools) causes many errors in automated update processes.
Just wanted to follow up on this - PR #702 looks like it would fix this issue by preserving version ranges during upgrades, which would be really useful.
I noticed it currently has merge conflicts, so it probably needs a bit of attention to get it ready to merge. @GREsau, would you be able to rebase it when you have some time?
Thanks for maintaining this project!
Still reproduces on 4.8.1: Version="[12.0.1,14.0.0)" becomes Version="13.0.4" after dotnet outdated R.csproj -u -inc Newtonsoft.Json. This also affects dotnet outdated GUI (#770), which runs -u. +1 for PR #702.
Activity
acatuttle commentedon Feb 22, 2023
Preferrably, version ranges would also be respected. This would effectively remove the need for the
--version-lockswitch and solve issues like #106 ? But that probably requires a lot more work.jeroensmink98 commentedon Mar 27, 2023
I'm also experiencing this but only if I run
dotnet outdatedin my Azure PipelineLocal expected output:
Acutal output of the CI Job:
This happens with both variants of running
dotnet outdatedThe version lock does not seem to work. But its pretty weird since on my local installation I use the exact same version of the tool as in my pipeline runner
spaasis commentedon Feb 21, 2024
Same here. Is there any workaround?
EDIT: some pertinent information:
.csproj:
<PackageReference Include="IronPython" Version="2.*"/>Output during the CI run:
IronPython 2.7.12 -> 3.4.1The result of the updated .csproj:
<PackageReference Include="IronPython" Version="3.4.1" />danm-de commentedon Apr 15, 2025
I've been hoping for a solution to this problem for a long time. The current behavior (both of Visual Studio's NuGet Solution Update and the command-line tools) causes many errors in automated update processes.
v1nz3 commentedon Jun 15, 2026
Just wanted to follow up on this - PR #702 looks like it would fix this issue by preserving version ranges during upgrades, which would be really useful.
I noticed it currently has merge conflicts, so it probably needs a bit of attention to get it ready to merge. @GREsau, would you be able to rebase it when you have some time?
Thanks for maintaining this project!
iamr8 commentedon Sep 25, 2026
Still reproduces on 4.8.1:
Version="[12.0.1,14.0.0)"becomesVersion="13.0.4"afterdotnet outdated R.csproj -u -inc Newtonsoft.Json. This also affects dotnet outdated GUI (#770), which runs-u. +1 for PR #702.