Newtonsoft bindingRedirect via manifest configuration component #4295
-
Newtonsoft(12.0.3) is a couple major versions ahead of DNN(10.0.3) now. Can someone share the proper xpath & syntax required by the manifest configuration component to create the following during a module install:
If it's not possible to generate that syntax via the manifest configuration component during a module installation that would be good to hear as well. I've tried multiple permutations but they all leave only the binding to the v12.0.3 as below which crashes an install.
The module project I'm looking at references a 3rd party library which depends on Newtonsoft v12.0.3. The code below does NOT work but it may help expose the error in my approach.
|
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 2 replies
-
What is the error that you get with the wide-sweeping rule? (NOTE: This is NOT a supported, nor-suggested, process to override and could very well have major impacts to DNN functionality) |
Beta Was this translation helpful? Give feedback.
-
Could not load file or assembly 'Newtonsoft.Json' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) [FileLoadException: Could not load file or assembly 'Newtonsoft.Json' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)] [FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)] [ConfigurationErrorsException: Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)] [HttpException (0x80004005): Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)] [HttpException (0x80004005): Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)] |
Beta Was this translation helpful? Give feedback.
-
Is it possible that you are using a 32 bit version of the dll? |
Beta Was this translation helpful? Give feedback.
-
What's the proper way to run side by side versions of a library without using bindingRedirects? |
Beta Was this translation helpful? Give feedback.
-
We do not have any suggested patterns, as they all have various negative drawbacks. The two primary methods that I've seen used.
I wish I could be more help here, but this is a very advanced, and sticky situation. I'll see if I can get a few of those that do this to jump in and give you some pointers. |
Beta Was this translation helpful? Give feedback.
-
See That said, I think that DNN would overwrite whatever change you make when it upgrades Newtonsoft. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the responses. I believe DNN is bumping the Newtonsoft version around DNN 10.. That's not too far off. I understand the config overwrites during an upgrade will be an issue until it overwrites to v12+ at which point I am guessing all will be fine and the bindingRedirects could be removed. I think the best I can do here is have admins do a module re-install/repair after a platform upgrade in the meantime to ensure a web config that will work for the module. That process is familiar to all DNN admins and the module I'm looking at would affect a specific workflow which is not cool... but it would not mean a system crash if an admin forgot to immediately do a post platform upgrade module re-install. Here is code that I am testing that appears to be working as desired. I think with a few minor tweaks it will work for any other side by side versioning issues as well. Let me know if you see some issue here other than the upgrade overwrite.
|
Beta Was this translation helpful? Give feedback.
-
You'll need to set |
Beta Was this translation helpful? Give feedback.
You'll need to set
xmlns="urn:schemas-microsoft-com:asm.v1"
on the elements in your<node>
element (or target thedependentAssembly
element instead of thebindingRedirect
, like the framework does, but you still need to specify it somewhere)