I've just started developing on the ArcGis Pro SDK and I'm running into an issue when binding transitive dependencies.
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-18.104.22.168" newVersion="22.214.171.124" />
The test module works fine & the binding redirect is found and works expected (see attached binding log)
When running in my ArcGis module the binding fails (also see attached)
Has anyone had experience in solving this problem? This is the second time I've hit this problem and I just worked around it before, but now I'd like to get to the bottom of the issue,
Any help much appreicated,
Pro application (ArcGISPro.exe) does not use the binding redirect you have used in your add-in.
The best way to solve your issue is to resolve the Pro assembly path from your module - this will allow your add-in to use the Newtonsoft from Pro's bin folder.
So in your Module's Initialize override -
private static string _arcgisProPath = @"C:\Program Files\ArcGIS\Pro\"; //Get install path from registry
public static Assembly ResolveProAssemblyPath(object sender, ResolveEventArgs args)
string assemblyPath = Path.Combine(_arcgisProPath, "bin", new AssemblyName(args.Name).Name + ".dll");
if (!File.Exists(assemblyPath)) return null;
Assembly assembly = Assembly.LoadFrom(assemblyPath);
protected override bool Initialize()
//Resolve ArcGIS Pro assemblies.
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveProAssemblyPath);