In my c# application , i am using reflection to load "A.dll" and use its methods to display a collection of records.
In the code i loads the dll from another folder(d:\loader\A.dll) at runtime.
Assembly dataAssembly = null;
dataAssembly = Assembly.LoadFrom("d:\loader\A.dll");
But I miss some column data in the datagridview and found that putting B.dll that was present in same folder where in A.dll was present to my exe execution path resolves the issue. However A.dll doesn't directly refer to B.dll and neither does B.dll show in reference assembiles of dataAssembly.
dataAssembly.GetReferencedAssemblies()
.Select(assemblyName => assemblyName.FullName);
Now i have a solution that B.dll is required in the exe execution path to show data but somehow i am restricted from adding it there in production environment.
I don't know what's there inside B.dll but i am 100% sure that i need to load this while accessing A.dll in my application.
Since i am using reflection for loading A.dll , i want to understand how i can handle this situation so that my application is able to find B.dll when it is running A.dll methods.
The folder path for B.dll is the same as that of A.dll .
Sorry and excuse me for the lack of understanding , but if you have any clues or hints , kindly advise.
Arefers to some other DLLBand that this is somehow leading to the wrong result? How? Is it thatBisn't present at all? IsAwinding up calling code in a differentBthan you want? So far, this question seems very vague. - Peter DunihoBbeing present? Or do you know whereBis, but it's just that it's not being found by .NET? How does DLLAreferenceB? Is it a regular assembly reference, or is it loading it dynamically? I'm assuming the latter, since normally if it were the former, a missing DLL would cause a run-time exception. - Peter Duniho