Hi,
I’m developing an ArcGIS Pro SDK for .NET add-in, and I’m encountering a runtime issue when sharing a class library between two module add-ins.
Project Structure:
- ClassLibrary1: a shared class library
- ProAppModule1: references ClassLibrary1
- ProAppModule2: also references ClassLibrary1
Steps to reproduce:
- Add only Method1 to ClassLibrary1 and build all projects.
- Implement ProAppModule2 to call ClassLibrary1.Method1 from a button.
- Add Method2 to ClassLibrary1, rebuild all projects.
- Implement ProAppModule1 to call ClassLibrary1.Method2 from a different button.
At runtime (inside ArcGIS Pro):
- Pressing the button in ProAppModule2 (which calls Method1) works fine.
- Pressing the button in ProAppModule1 (which calls Method2) throws a MissingMethodException or similar, saying the method is not found.
It seems that ClassLibrary1.dll from ProAppModule2 is always the one being loaded, even though ProAppModule1 has its own reference to the updated DLL.
This behavior occurs only when both add-ins are present. If only one add-in exists, everything works as expected.
Question:
Is there a known issue or best practice for referencing a shared class library from multiple ArcGIS Pro Add-in modules?
How can I ensure that both add-ins use the correct and updated version of the shared assembly at runtime?
Is there a recommended way to isolate or unify shared library usage between add-ins?
Any advice would be greatly appreciated. I've attached a minimal repro project (CommonClassLibraryTest.zip).
Thank you!