Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sam 26 posts 137 karma points c-trib
    Nov 25, 2015 @ 20:18
    Sam
    0

    Umbraco Dependency Hell

    Hi guys,

    I have a bunch of different class libraries that I include into my Umbraco sites that add a bunch of different functionality, overloads etc. These class libraries have the nuget package UmbracoCms.Core installed. This currently works great.

    My problem is when a new version of Umbraco comes out. If I update my class libraries my older websites will break, meaning I end up with an artifical freeze on the version of Umbraco, until I can update them all.

    Has anyone else had this problem? How have you solved it?

    I don't really want to end up with multiple versions of the code, just for between minor versions of Umbraco.

    Thanks, Sam

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Nov 26, 2015 @ 08:30
    Sebastiaan Janssen
    0

    The trick is to target the lowest common denominator.

    If the oldest Umbraco version you have is 7.2.1 then make sure all of your class libraries install that version (Install-Package UmbracoCms.Core -Version 7.21).

    Also, always makes sure that your class library doesn't require a specific version of the Umbraco core libraries. I think NuGet sets this up correctly for you so you shouldn't have to worry about it.

    The reason you want your class libraries to have the lowest version of UmbracoCms.Core installed is to make absolutely sure that you're not using APIs that were opened up in newer versions of Umbraco. If you call a new API and copy your class library into and older Umbraco version you would indeed just get errors.

  • Christopher Pascual 25 posts 273 karma points
    Nov 26, 2015 @ 10:15
    Christopher Pascual
    0

    Is -ignoredependecies an option?

    update-package [yourclasslibrary] -ignoreDependencies

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Nov 26, 2015 @ 10:18
    Sebastiaan Janssen
    0

    No, please don't use IgnoreDependencies unless you have a very specific reason and you know what you're doing.

  • Sam 26 posts 137 karma points c-trib
    Nov 27, 2015 @ 01:25
    Sam
    0

    Should I have my class project set up as a nuget package that I am installing?

Please Sign in or register to post replies

Write your reply to:

Draft