Skip to content

Directory.Build.props not supported #301

Closed

Description

@csMACnz

I'm looking to convert over from NuKeeper to using dotnet-outdated, but have a missing requirement.

Nukeeper had the functionality that if a Directory.Build.props file existed and provided a package version, it would correctly update that package version in that file.

The current version of dotnet-outdated seems to instead just fail with An error occurred while upgrading MyProject instead.

An example Directory.Build.props file like we might use at the root of our repository.

<?xml version="1.0" encoding="utf-8"?>
<Project>
  <ItemGroup>
    <PackageReference Include="My.Org.CodeStandards" Version="1.2.3" />
  </ItemGroup>
</Project>

Activity

  1. sloncho commented on Aug 4, 2022

    @sloncho

    That would be very useful

  2. Krudonix commented on Jan 23, 2023

    @Krudonix

    Please implement this ;)

  3. CoenraadS commented on Feb 9, 2023

    @CoenraadS

    You can try using Central Package Management instead https://devblogs.microsoft.com/nuget/introducing-central-package-management/

    It should play nicely with dotnet commands.

  4. timabell commented on Nov 12, 2026

    @timabell
    Contributor

    this can probably be closed,

    props support has been in it for a while now, however...

    it has some issues with the regex...

    and the specific requirement requested:

    1. "if a Directory.Build.props file existed"...
    2. "and provided a package version"

    the second point is still throwing an error in master.

    I have a branch in progress that swaps the regex for a full xml editor that should fix this properly and reduce further problems. PR incoming with a bit of luck

    The underlying error from dotnet add is now clearer in this scenario now that c3fbf21 is in master. Showing the error from the call to dotnet add of "Cannot edit items in imported files".

    This error string comes from:

    Some related issues in this area for more context. It seems that dotnet add probably should in theory be able to make these changes.

    I see that NuKeepr is archived in favour of dependabot + dotnet-outdated, hence needing this support

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions