Loading RunTime Component dynamically RRS feed

  • Question

  • According to

    I like to load dynamically RunTimecomponent in my application. According to above post we can’t. This post is 5 years old. I am not sure if still it is true.  I don’t want to include the RunTime Component in manifest.


    Agha Khan

    Wednesday, November 8, 2017 5:57 AM

All replies

  • The post doesn't say you cannot load an assembly dynamically.

    You can off course load an assembly dynamically using Assembly.Load(AssemblyName). Check this for details  

    Friday, November 10, 2017 11:07 AM
  • Thank you Sezhiyan:

    As you know RunTime components don't produce Dll, rather produces xbf type file, so Assembly.Load doesn't apply. 

    Best regards


    Agha Khan

    Friday, November 10, 2017 4:27 PM
  • Hi , 

    You can load any assembly , create instance of a classe , get all members and properties .

    Assembly.Load("Name") ,LoadFile(@"c:\xxx.dll") or LoadFrom()

    Type type = Type.GetType("TypeName", true);
    object instance = Activator.CreateInstance(type);
    PropertyInfo prop = type.GetProperty("PropertyName");
    prop.SetValue(instance, value, null);

    Saturday, November 11, 2017 12:09 AM
  • Thank you Omid:

    As I explained above RunTime components don't produce Dll, so we can't use Assembly.Load("Name")

    Thanks for your reply.

    Agha Khan

    Saturday, November 11, 2017 2:51 AM
  • Hi Agha,

    By xbf if you are are referring to XamlBinaryFiles, then you should be able to read/load them using the XamlReader class ( ), right ?


    Monday, November 13, 2017 8:46 AM