Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reflection between differents projects (assemblies)

Is there any way, from a given project, to create instances of classes contained in other projects ?

I usually use Assembly.GetExecutingAssembly().CreateInstance(), but obviously, this call will return NULL as the class I'm specifying is held in another project.

Any ideas ?

like image 224
Francis Ducharme Avatar asked Aug 05 '26 09:08

Francis Ducharme


1 Answers

If you really want to use reflection to achieve this then look at Assembly.LoadFrom(). http://msdn.microsoft.com/en-us/library/system.reflection.assembly.loadfrom.aspx Alternatively, as someone pointed out, you can simply use project references.

like image 100
Tejas Sharma Avatar answered Aug 06 '26 21:08

Tejas Sharma



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!