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.
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.
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
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.
Is -ignoredependecies an option?
update-package [yourclasslibrary] -ignoreDependencies
No, please don't use IgnoreDependencies unless you have a very specific reason and you know what you're doing.
Should I have my class project set up as a nuget package that I am installing?
is working on a reply...