1
votes

In a project we have Umbraco 7.3.4 and it has a dependency for JSON.NET <= 6.0.8. When I'm trying to install other 3rd party packages which require JSON.NET >= 8.0.0, this forces Umbraco to automatically update to version 7.4, which I don't want.

Putting aside considerations of pros and cons of making a hack, I am happy to do a hack because I know that Umbraco works with JSON.NET 8.0.0. The question is how to disable in Nuget automatic update (dependency resolving) only for the Umbraco package? In an ideal case (and much better one) I would only want to ignore JSON.NET dependency for Umbraco package, but let Nuget update Umbraco package if any other cross-dependency update requires this.

Many thanks for an advice

1

1 Answers

0
votes

This isn't an Umbraco feature but a Nuget feature, you can include the flag -IgnoreDependencies but it's not selective as far as I am aware. Beware you may well miss other dependencies that could cause you to end up in dependency hell!

Example:

Update-Package Newtonsoft.Json -Version 8.0.0 -IgnoreDependencies

Nuget Documentation:

-IgnoreDependencies
    Installs only this package and not its dependencies.

    Required: false

See https://docs.nuget.org/consume/package-manager-console-powershell-reference

Warning: Backup your project before attempting this so you can roll it back in the event of a problem!