Version independent equivalent to the "is" operator...

  • Thread starter Thread starter Nathan Baulch
  • Start date Start date
N

Nathan Baulch

What is the best way to find out if a certain object implements any version
of a specific interface?

I have a plugin system in which plugins implement interfaces stored in
strongly named assembly in the GAC.
The plugins, which are dynamically loaded by the host, could potentially
reference any version of that assembly.

Do I need to manually search through the Assembly.GetReferencedAssemblies
and compare based on Name+PublicKey?
And once I confirm that it implements the interface, can I only use
reflection to call its members?


Nathan
 
Nathan,
And once I confirm that it implements the interface, can I only use
reflection to call its members?

Yes. Wouldn't it be easier to use binding redirects or publisher
policy to redirect all previous versions of the plugin assembly to the
latest one, and then just use the is operator and call through the
interface?


Mattias
 
Back
Top