Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

Reflection to load dependent dll's

$
0
0

My c# application exe is running in c:\MyApplication folder .

I am using reflection to load dll "A" and display collection of values .

Assembly appAssembly =null;
appAssembly =Assembly.LoadFrom("c:\Dll\A.dll");

Then i use the methods in A.dll to assign data to a datatable. But there are empty values coming in one column.

I am getting proper values when i set my exe to run in C:\Dll folder. Hence i found that there is some dependency dll in c:\Dll responsible for showing proper values. 

I found that "B.dll" is dependency dll and when added in c:\MyApplication folder gives me data properly.

I should not be adding "B.dll" to application directory because this would mean i add a direct reference of the DLL in my project.

My code is supposed to use  reflection to load the dll types and i am not sure how will i refer B.dll in my application at runtime so that i get proper values from A.dll methods. 


Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>