How to load an external assembly with references?

W

W. Jordan

Hello,

I am trying to load an assembly A which references an external assembly B,
by using Assembly.LoadFile method. A was loaded but B was not.
When I try to invoke a method in A, which requires assembly B, it fails.
How can I solve this?
 
V

Vadym Stetsyak

Hello, W.!

There are several ways how to resolve.
- you can load assembly B prior to A
- put B's path into binding redirection config.

Have a loot here how runtime locates assemblies
( http://msdn2.microsoft.com/en-us/library/yx7xezcf.aspx )

WJ> I am trying to load an assembly A which references an external
WJ> assembly B,
WJ> by using Assembly.LoadFile method. A was loaded but B was not.
WJ> When I try to invoke a method in A, which requires assembly B, it
WJ> fails.
WJ> How can I solve this?

WJ> --


WJ> Best Regards,
WJ> W. Jordan





--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 
W

W. Jordan

Thank you for your reply.

I tried loading B prior to A. However, an object OBJ created with the method
in A was used as an ExtentionObject for an XSLT file. The XSLT file
reported that it could not locate B, when it tried to execute a method
provided by OBJ.

I forgot to say that the B is in another drive, the binding redirection
does not work in such a scenario. And what's more, is it possible
not to modify the configuration file?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top