Skip to main content Dennis Traub - Software Engineer & Developer Advocate

Posts on .NET

  1. Upgrading .NET dependencies: Essential dotnet CLI commands

    Need to update your .NET packages? Here are the key commands you’ll need:

    Check for Updates:

    shell code snippet start

    dotnet list package --outdated

    shell code snippet end

    Update Packages:

    Single package (latest version):

    shell code snippet start

    dotnet add package PackageName

    shell code snippet end

    Specific version:

    shell code snippet start

    dotnet add package PackageName --version 1.2.3

    shell code snippet end

    Bulk updates:

    While there’s no built-in command to update everything, you can use dotnet-outdated:

    shell code snippet start

    dotnet tool install --global dotnet-outdated-tool
    dotnet outdated -u  # Updates all packages

    shell code snippet end

    Pro tip: Always backup, and test after upgrading. Add --prerelease if you need preview versions.

    /* End of post */