Hi! I've decided to learn a little more about Umbraco but have already stumbled into an error that i seem not to solve.
I create a new empty mvc 4 project and install the Umbraco CMS via Nuget. All works fine until that I want to use bundling and for that i need to install Web Optimization via Nuget. When trying to do this it causes and error where Newtonsoft.Json doesnt work well with Umbraco.core. The exact error is:
Install failed. Rolling back...
Updating 'Newtonsoft.Json 4.5.11' to 'Newtonsoft.Json 5.0.8' failed. Unable to find a version of 'UmbracoCms.Core' that is compatible with 'Newtonsoft.Json 5.0.8'.
I understand the problem but how do i get around it? If i dont get this installed, how can i use bundling?
Unfortunately we need to rely on an older version of Json.Net for compatibility with several packages.
You have 2 options:
Have a look at the ClientDependency Framework, it does a lot of the same things and is bundled with Umbraco
Uninstall the current json.net version Uninstall-Package Newtonsoft.Json -Force from your package manager console, you should then be allowed to install the optimization framework
Of course with the last option, you might run into trouble later when you start installing packages.
The problem with supporting other versions of json.net is due to a crazy versioning scheme that they have which makes it very difficult for us to solve this issue out of the box. We're looking into it though and hope to have a solution at some point.
@Sebastiaan - Is there a list of packages available that's causing this versioning clash? I'm frequently finding myself wanting to upgrade some of the Nuget packages due to wanting to install 3rd party Nugets that require newer versions, and would love a way to get around this as I'm sure would a lot of other people :)
Is there a plan at some point to effectively cut-off those legacy packages and "mark" them as not working with the current version of Umbraco? Call it a Breaking Change?
alternatively, is there some sort of watch dog that can be put in place in the package installer that checks dll versions against a "blacklist" and refuses to install them, updating the bindingRedirect instead?
Ok, my late night ramblings are over - heading to bed.
@Robert Unfortunately, we'll always be behind as we can't anticipate what new versions dependent packages are releasing. We're erring on the side of caution because we've seen major breakage before with packages updating. If you want to upgrade to a version that's not known to work with Umbraco then that's up to you, use the --Force .. :-)
We are trying really hard to conform to Semantic Versioning which means that we're only allowed to introduce breaking changes on major version. Sometimes we do it on minor or patch versions based on some "rules":
hardly anybody is using this API so a breaking change won't be too problematic (but we REALLY REALLY want to avoid this reason most of the time!)
it is an extremely disruptive bug and we can only fix it by creating a breaking change
currently it's impossible to use this API so it's okay to make a breaking change in order to fix that
@Pav Yes, and that's what we have now, but some people are eager to use MVC 5, Web API 2, Json.Net 6, etc. All of which have breaking changes and will break parts Umbraco. Unfortunately we can't catch up fast enough and that's a pain.
Some packages will work, so try using the -Force command but for others we know that they will definitely break Umbraco.
We expect and hope that all packages that we depend on will not introduce breaking changes in their minor/patch releases so we've set the range to be higher than the current version but lower than the next major version.
MVC 4 with Umbraco 7.0.2 Web.Optimization problem
Hi! I've decided to learn a little more about Umbraco but have already stumbled into an error that i seem not to solve.
I create a new empty mvc 4 project and install the Umbraco CMS via Nuget. All works fine until that I want to use bundling and for that i need to install Web Optimization via Nuget. When trying to do this it causes and error where Newtonsoft.Json doesnt work well with Umbraco.core. The exact error is:
Install failed. Rolling back...
Updating 'Newtonsoft.Json 4.5.11' to 'Newtonsoft.Json 5.0.8' failed. Unable to find a version of 'UmbracoCms.Core' that is compatible with 'Newtonsoft.Json 5.0.8'.
I understand the problem but how do i get around it? If i dont get this installed, how can i use bundling?
/Haris
Unfortunately we need to rely on an older version of Json.Net for compatibility with several packages.
You have 2 options:
Uninstall-Package Newtonsoft.Json -Force
from your package manager console, you should then be allowed to install the optimization frameworkOf course with the last option, you might run into trouble later when you start installing packages.
The problem with supporting other versions of json.net is due to a crazy versioning scheme that they have which makes it very difficult for us to solve this issue out of the box. We're looking into it though and hope to have a solution at some point.
Thank you very much, I'll have a look into ClientDependency :)
/Haris
Just to all who had same problem
When you creating new project and want to use nuget to install umbraco.
* Create new empty project.
* Make sure is empty (remove all packages)
* Install umbraco
* Apply updates on any packages you want to update (might not work because backwards compatibility)
hope this helps
You could also consider using a slightly older version of ASP.NET Web optimization, i.e. version 1.1.0
See: https://www.nuget.org/packages/Microsoft.AspNet.Web.Optimization/1.1.0
You can install it through the Package Manager Console with the command:
Install-Package Microsoft.AspNet.Web.Optimization -Version 1.1.0
Thanks John, I'd been stuck on this error but installing version 1.1.0 of the package was a quick and painless fix!
Hi Sean
I've successfully used the web optimisation framework in 6 and 7. So it was useful to find out there have been version clashes.
I'll stick with v1 for now!
Martin
@Sebastiaan - Is there a list of packages available that's causing this versioning clash? I'm frequently finding myself wanting to upgrade some of the Nuget packages due to wanting to install 3rd party Nugets that require newer versions, and would love a way to get around this as I'm sure would a lot of other people :)
Is there a plan at some point to effectively cut-off those legacy packages and "mark" them as not working with the current version of Umbraco? Call it a Breaking Change?
alternatively, is there some sort of watch dog that can be put in place in the package installer that checks dll versions against a "blacklist" and refuses to install them, updating the bindingRedirect instead?
Ok, my late night ramblings are over - heading to bed.
- Rob.
@Robert Unfortunately, we'll always be behind as we can't anticipate what new versions dependent packages are releasing. We're erring on the side of caution because we've seen major breakage before with packages updating. If you want to upgrade to a version that's not known to work with Umbraco then that's up to you, use the --Force .. :-)
We are trying really hard to conform to Semantic Versioning which means that we're only allowed to introduce breaking changes on major version. Sometimes we do it on minor or patch versions based on some "rules":
@Sebastiaan no-one expect your being always in front of all packages=> impossible
instead you could specify in your nuget packages specific version that you require or range. this way you will be able to avoid disappointed people.
I thing that would be nice middle ground, don't you think?
pav
@Pav Yes, and that's what we have now, but some people are eager to use MVC 5, Web API 2, Json.Net 6, etc. All of which have breaking changes and will break parts Umbraco. Unfortunately we can't catch up fast enough and that's a pain.
Some packages will work, so try using the -Force command but for others we know that they will definitely break Umbraco.
We expect and hope that all packages that we depend on will not introduce breaking changes in their minor/patch releases so we've set the range to be higher than the current version but lower than the next major version.
Click for a larger version:
is working on a reply...