Update reference request: Newtonsoft.Json

This forum is for programmers who have questions about the source code.
Post Reply
BPalmer
Posts: 6
Joined: Wed Jun 28, 2017 7:05 pm
Location: United States

Update reference request: Newtonsoft.Json

Post by BPalmer » Wed Jun 28, 2017 7:18 pm

Working on a new plugin, one of my plugin dependencies requires Newtonsoft.Json 10.0.2, OpenDentBusiness is currently referencing version 9.0.1. Could you please update this to the latest stable?

Thanks

User avatar
jsalmon
Posts: 1551
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Update reference request: Newtonsoft.Json

Post by jsalmon » Thu Jun 29, 2017 11:30 am

No, we always have unintended side affects when it comes to updating dlls. We had many problems when we went from Newtonsoft.Json v7 to v9.
What I would be willing to do is increase the dependentAssembly node of our app.config that might let your customers use the new v10 dll. Can you manipulate the Open Dental app.config code to include your v10 information and let me know if it works? The code I'm referring to looks like this:

Code: Select all

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
	<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
	<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
  </dependentAssembly>
</assemblyBinding>
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

BPalmer
Posts: 6
Joined: Wed Jun 28, 2017 7:05 pm
Location: United States

Re: Update reference request: Newtonsoft.Json

Post by BPalmer » Thu Jun 29, 2017 4:49 pm

Thanks for your support, I was actually able to make it work without any changes on your end. Seems to be working just fine, from my understanding and from limited testing, this shouldn't break anything

Code: Select all

public override void LaunchToolbarButton(long patNum) {
	AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
}

private System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) {
	return Assembly.LoadFrom("Newtonsoft.Json.v10\\Newtonsoft.Json.dll");
}

Post Reply