Using instances in an AFPlugin assembly in a client application

Discussion created by MichaelvdV@Atos on Nov 4, 2010
Latest reply on Nov 9, 2010 by MichaelvdV@Atos

Please consider the following situation:


We have a custom DataReference in Assembly 'A'. The custom DataReference uses a static caching mechanism in a static class ('A'.Cache). Assembly 'A' is registered with AF using RegPlugin. Next, we have a Scheduler application in Assembly 'B'. 'B' uses AFSDK to get values from the DataReference in 'A'. Calls are abstracted by AFSDK, so there is no direct knowledge or reference of Assembly 'A'.


Now, we need to access the Cache from Assembly 'A'. This is a static class.




How can I access the same 'A'.Cache in both the Scheduler application ('B'), as in the DataReference ('A')?


Considered Solution: 


My first thought would be to reference 'A' in 'B', since it will be loaded into 'B' at runtime by AF. Then, I could access 'A'.Cache.


This isn't working. There is a new static reference to 'A'.Cache, not the one that has been accessed by the datareferences in 'A'.


My thoughts are that 'A' is loaded into another appdomain then the current appdomain by AFSDK.