Skip to content

Downgrading a package with dotnet add package --version is silent #56

Closed

Description

@Shewart

Summary

When the CLI adds a NuGet dependency (for example Blazor-ApexCharts for charts) with dotnet add package X --version <v>, and the project already references a higher version of X, the reference is silently downgraded.

Expected

Keep the higher version (and say so), or ask before downgrading.

Suggested fix

Read the existing PackageReference before calling dotnet add package, and skip the call when the installed version is equal or higher. Add a test with a project that already references a newer version.

Activity

  1. added 2 commits that reference this issue on Oct 18, 2026
    5697f23
    55c118f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions