Typeconverter from dll

I am using the grid property with a class and associated type converter. When I moved the class and TypeConverter to a DLL, it seems that it is not being called. Cannot find how to activate typeconverter from dll.

Assembly a = Assembly.LoadFile(modulepath + elementname + ".dll");
try
{
    object myobj = a.CreateInstance(objectname);            
    Type objecttype = myobj.GetType();
}

Appreciate any tips. Thanks.

+3
source share
2 answers

This may be because Assembly.LoadFile loads the file in a different binding context from the rest of your code.

+2
source

You have something similar on your class:

   [TypeConverter(typeof(MyClassConverter))]
 public class MyClass {
    // Insert code here.
 }

Usually, if a class has a type converter associated with it, it should pick it up.

+2
source

Source: https://habr.com/ru/post/1725920/


All Articles