Skip to content

Support Variables like AspNetVersion, EntityFrameworkCoreVersion, etc. #597

Closed

Description

@ardalis

Ran this recently on my /nimblepros/eshoponweb project and did a quick YouTube video of it here:

https://www.youtube.com/watch?v=7fHvJT8UyL8&lc=UgxCvDM9JmDNXkS1u314AaABAg.A9rktIetkIcA9x-5xT_SAU&ab_channel=Ardalis

Had a comment from someone noting that my commit nuked a bunch of variables and replaced them with fixed values. I hadn't even noticed, honestly, as I haven't been intentionally using those variables much to date. But they were right:

image
source: NimblePros/eShopOnWeb@28d8f96

So, my question/request is, are you planning on supporting apps that use such variables, in which case you'd only update the variable and not all of the PackageDependency entries.

Here's the variable definition in packages.directory.props:
image
source: https://github.com/NimblePros/eShopOnWeb/blob/main/Directory.Packages.props

Activity

  1. hwoodiwiss commented on Mar 6, 2025

    @hwoodiwiss
    Contributor

    If there's appetite for this from the maintainers, I'd be interested in picking this up, I run into this fairly frequently, so it'd be a nice QoL feature for me.

  2. slang25 commented on Mar 6, 2025

    @slang25
    Member

    That would be awesome @hwoodiwiss, please do 🙂

  3. slang25 commented on Mar 6, 2025

    @slang25
    Member

    Have in mind that we don't use MSBuild to do a proper evaluation, so we'll only ever support basic scenarios and not the full dynamicness of MSBuild.

    Here's a related (and outdated) PR: #535
    not quite the same, but a related scenario where folks would use the convention of a separate dedicated file to update dependency versions (pre-dates CPVM).

  4. hwoodiwiss commented on May 7, 2025

    @hwoodiwiss
    Contributor

    Just an update to say I've not forgotten about this, just trying to fit it around things and come up with a solution that isn't too terrible. 😅

    For the moment, I'm thinking of an Xpath based solution that somewhat bookends the main flow, capturing variables and their related packages before we update packages, then re-applying the variable and updating the variable definition afterwards, just need to actually sit down and write the code to do that.

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