2

My current asp.net mvc app needs 11.0.2 version of 'Newtonsoft.Json'

However, I want to add a nuget package "UmbracoCMS" that needs Newtonsoft.Json (>= 10.0.2 && < 11.0.0)'

Please let me know how I could handle this in the web.config

I tried assemblyredirect but that didn't help. Thank you.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
John
  • 693
  • 1
  • 12
  • 37

1 Answers1

2

Unable to find a version of 'Newtonsoft.Json'

This issue is not related to assembly-redirect, so you could not resolve it by web.config. That is because the prerequisite for assembly-redirect is that different versions of the Newtonsoft.Json assembly should be all acceptable for your project and we use assembly-redirect to select one of the version to our project.

Check a sample link.

However, your current question is that you can not get both versions to work for your project. Your asp.net mvc app needs 11.0.2 version of Newtonsoft.Json, but the nuget package UmbracoCMS that needs Newtonsoft.Json (>= 10.0.2 && < 11.0.0). You can not use both versions, so you can not use assembly-redirect to select one of the version to your project.

To resolve this issue, you have to resolve the reference conflict. Could you only use Newtonsoft.Json 11.0.2 for your asp.net mvc app? Can you use Newtonsoft.Json 10.0.2/10.0.3 instead? If yes, you can install Newtonsoft.Json 10.0.2/10.0.3, then you can install the nuget package UmbracoCMS. If not, I am afraid you could not install the nuget package UmbracoCMS.

Hope this helps.

Community
  • 1
  • 1
Leo Liu
  • 71,098
  • 10
  • 114
  • 135