Assembly version Newtonsoft.Json

Topics: Administration, Core, Customizing Orchard, General, Writing modules, Writing themes
May 16, 2014 at 9:13 AM
I must use Mandrill.dll in my module. it needs Newtonsoft.Json v6. but in bin folder of Orchard we have Newtonsoft.Json v4.5.
I add reference to the new one in my module. but module loads old dll in run time and new dll does not copy in App_Data\Dependencies folder. How can i do in some cases? i am forced to use new version of some dll in some case but orchard has old one and does not pick up my referenced dll in module.
May 16, 2014 at 1:22 PM
What can i do when i need newer version of any library for my module?
May 16, 2014 at 2:23 PM
Don't think you can do that easily. You could (if its bw compatible) 'try' to overwrite the Orchard one with the v6 one.

Alternatively, you could try to create a custom Mandrill.dll build that uses the Orchard version of that dll (assuming it doesn't depend on new stuff)
May 16, 2014 at 2:32 PM
I tried to create new mandrill.dll with orchard version of Newtonsoft.Json but it depends on new fearures of Newtonsoft.Json.
Overwriting orchard version also has very very side effect in other modules.
This is very very big problem to handle assemblies in Orchard system.
I am in a hurry but i must wait until Orchard team upgrade Newtonsoft.Json to last version. There is same story for any other libraries.
May 16, 2014 at 2:33 PM
Welcome to DLL hell ;)
May 16, 2014 at 2:58 PM
Thank you so much!
May 16, 2014 at 6:52 PM
I think I done this in the past, overriding orchard version in lib and updating the assembly binding in web.config
  <dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"/>
    <bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0"/>
  </dependentAssembly>
May 16, 2014 at 7:06 PM
Should i place this in web.config of module?
May 16, 2014 at 7:28 PM
You have to set the correct version and put it in the orchard.web web.config, replacing it.
May 16, 2014 at 7:55 PM
Changes in web.config of Orchard.web is globally and can have side effect on other modules. This means upgrading library of orchard. Also i cannot publish my module in this case. I am looking for a solution limited to my module only. Anyway thank you for your reply.
May 16, 2014 at 8:27 PM
Have you tried ?
May 16, 2014 at 8:34 PM
Some modules may need old version of library. Also everyone want to install my module must modify web.config.
Developer
May 19, 2014 at 9:52 PM
Pull Orchard 1.x - You now have the latest version 6.0.3 :)