XrmToolBox
XrmToolBox copied to clipboard
Bumped Microsoft.Bcl.AsyncInterfaces to version 9 to fix version mismatches when loading plugins.
Since all XTB plugin assemblies are loaded into the same application domain, issues might arise if one plugin is loaded that has a dependency to an older version of Microsoft.Bcl.AsyncInterfaces, and a subsequently loaded plugin has a dependency to a newer version.
An example - the Plugin Registration plugin references version 8.0.0.0 of Microsoft.Bcl.AsyncInterfaces. When this plugin is loaded, version 8 of the assembly is loaded into the Application Domain. Then, another plugin is loaded that references Microsoft.Bcl.AsyncInterfaces version 9.0.2, for example a plugin that uses the Anthropic library.
Now two assemblies with different version are loaded into the same App Domain, which can be seen if dll binding is logged, using Fuslogvw.exe:
This can cause issues like MissingMethodException if the second plugin needs functionality not available in the older version of Microsoft.Bcl.AsyncInterfaces, as is described here.
Bumping the version of Microsoft.Bcl.AsyncInterfaces to the latest version and adding binding redirects resolves this issue, and should also work for any existing plugin that references older versions because of backwards compatibility.