Re: Dynamically loading an assembly
- From: "Ming Chen" <ming.chen@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 14 Nov 2005 14:22:03 -0500
Hi, Mark
You don't have to use reflection for every method call if the class
defined in B implements an interface that is accessible in A.
For example, you can define assembly C, which contains an interface
definition for a type in B. Reference C when you are building A. At runtime,
after creating an object that is defined in B using reflection, you can
immediately cast it to the interface defined in C and then you don't need to
use reflection in subsequent calls.
--
Ming Chen
http://engdump.blogspot.com/
<markoueis@xxxxxxxxxxx> wrote in message
news:1131995243.408910.324800@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Our .NET application, let's call it A, needs to load an assembly of
> another .NET application, let's call it B. Preferably I would like to
> early bind and early load the B assembly. However, in a deployment
> scenario, it is possible that B is not installed, in which case, the
> dependencies for its assembly won't be there. When I try to load that
> assembly (which is copied) regardless, my application crashes saying
> that its dependencies cannot be found.
>
> What's the best way to solve this problem? I could late bind the
> assembly, but then do I really have to use reflection for each and
> every method call I make against this assembly? If this is so, are
> there any OO design techniques out there I can use? Is there any way I
> can still compile against that assembly?
>
> Are there any good solid articles on this kind of development?
>
> Thanks
>
> Mark
>
.
- Prev by Date: Re: How to run Self extracting ZIP file from C# Application
- Next by Date: Flexible class architecture question
- Previous by thread: Re: Dynamically loading an assembly
- Next by thread: Catching generic exceptions
- Index(es):
Relevant Pages
|