c# - Type check on runtime loaded assembly -
i'm facing problem using external dlls mono @ runtime. suppose have framework dll containing interface imyinterface, "plugin" project using framework in class implements imyinterface interface. plugin, once deployed dll, loaded framework @ runtime, , classes implements imyinterface must added collection within framework. this, type test must done on types. unfortunately, when types loaded dll, type test fail if imported class implementing known interface. more precisely, following statement
importedtype.gettype().isassignablefrom(typeof(imyinterface))
returns false, if type implements imyinterface. suppose imported type system.runtimetype, , not system.type. how can deal issue? may interface imyinterface has different signature across same assembly used different solutions?
isassignablefrom 1 of confusing method
typeof(imyinterface).isassignablefrom(myobject.gettype()) typeof(imyinterface).isassignablefrom(importedtype)
https://msdn.microsoft.com/en-us/library/system.type.isassignablefrom(v=vs.110).aspx
Comments
Post a Comment