Unfortunately I don't think this will work. The add-ins already have the
required resources. Here is the more detailed description of what I want to
do. I fear I won't be able to do what I want due to .Net licensing policy
:-(...

We have a generic container which runs our application. The application uses
pluggable modules (add-ins) which are discovered at run time and loaded as
needed from satellite assemblies. The app is designed to be extended by
clients who can write their own add-ins. As long as they follow our rules,
their add-ins will appear seamlessly in our app. The add-ins may have a UI
component, usually they do, although the UI aspect is not necessarily
relevant. And as I mentioned originally, the add-ins get loaded via
reflection at run time. The problem occurs when the add-ins use a licensed
component. It seems .Net requires the _executing assembly_ (the generic
container in our case) to have the licensing information embedded in it when
it tries to create an object which uses a licensed component. Otherwise the
creation fails. Even if the license info is embedded in the add-in assembly,
that's not enough. It must also be embedded in the executing assembly.

My theory is that if I could modify the container (at run time, obviously we
don't know all the licensed controls clients' add-ins might use at compile
time) to some how dynamically load a license resource and make it appear
like it's embedded in the container EXE, perhaps I could enable the clients'
add-ins to use licensed controls. All they'd have to provide is the license
resource in some format the container would use to load and embed the
resource in its assembly (at run time). If this is not possible, then the
concept of using run time add-ins which wrap licensed components will not be
possible in a .Net app AFAIK.

Any comments or suggestions welcome.



> -----Original Message-----
> From: Matthew Adams [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 31, 2002 10:47 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [ADVANCED-DOTNET] embedding resources
>
>
> Why not embed the resources in the plug-in assemblies, and
> use the same
> mechanism you use to load the plugins to load their resources?
>
> M
>
> -----Original Message-----
> From: Moderated discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED]] On Behalf Of
> Peter Zaborski
> Sent: 31 May 2002 16:41
> To: [EMAIL PROTECTED]
> Subject: [ADVANCED-DOTNET] embedding resources
>
> I posted this to the "regular" dotnet mailing list but had no replies.
> Perhaps someone on this list has an answer?
>
> I know it's possible to embed resources in an assembly during the
> compile
> process. Which works fine if you know all the resources you
> need at that
> time. However, I have a situation where I need a resource in my EXE
> assembly, but I don't know about the resource until run time. In case
> you
> are wondering, this is for a "generic container" type
> application which
> loads satellite assemblies containing add-ins via reflection
> using late
> binding -- the container does not know all the add-ins it will use at
> compile time. The application and its add-ins are all
> strictly desk top
> WindowsForms, no WebForms stuff at all.
>
> Any one know if it's possible to dynamically (ie. at run time) embed
> resources in an EXE assembly? Or in some other way make it appear that
> the
> resources are embedded in the executing assembly at run time?

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to