Assembly metadata and event wiring.

S

Scott M

I'm building a smart client application based off of the
example that is posted on windowsforms.com (and shown on
the .NET show). A windows form calls a webservice that
itterates through a directory, pulling meta data from all
the assemblies located in that directory. Then returns
that information for the form to consume and to be able to
dynamically load the assemblies.

What I've done is define 3 events that my dynamic
assemblies (Those downloaded from the web server) can
call. I want the stub application to capture these events
and to handel them (Either from different event handlers
or passing a string to one event of which type to fire).
(I plan on making the events the same name in every
dynamic assembly, BTW)

I've searched for 3 days on articles on how to do this.
Can anyone help?

Do I need to place special attributes on the event to pull
out of the assembly? ANY help would be appreciated...

Would this (and the extra credit) be easier if I signed
the assemblies with a strong name and let my application
grant full trust to the assemblies? (Which I'd rather not
do b/c of, of course, security issues. And I want this to
be as no touch as possible. A user may download this over
the internet so the application itself will not have the
full trust to grant to the assemblies.)

Extra credit :) : I'd also like to take the XML outputted
from a web service (Which tells me what assemblies are
available) and cache that to the disk. If the web service
isn't available, read that XML. And if I can't reach the
web server to pull the assemblies down, is there a way I
can persist them to the disk and load the assemblies from
there?
 
S

Scott Meddows

Sorry, this is the code I'm using right now....

Dim controlAsm As [Assembly] = [Assembly].LoadFrom
(ItemInfo.UrlLocation & ItemInfo.AssemblyName)

Dim controlType As Type =
controlAsm.GetType(ItemInfo.TypeName)
ControlToLoad =
Activator.CreateInstance(controlType)
owner.AddControl(ControlToLoad)


This is located on a click event of my stub application.

Thanks.
 

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