Referencing external forms

P

pipbailey

I have a VB.net EXE application (VS05). It is really just an empty MDI
container for lots of forms that are also VB.net forms, but are in
other external DLL assemblies (some VS03 others VS05). I have built
two such external assemblies and loading the forms in my EXE container
is easy. I just reference the assembly in Project References and then
import the namespace. Bingo!

My question is that the project references screen displays the
absolute path to these assemblies on my computer. When I deploy these
assemblies using multiple MSI installpacks their locations may change
(depending on where the user choose to install them). Is my container
going to find these DLLs on the deployment machine and use them OK?

Is there a way to load a reference dynamically in the code and use a
form on the fly without having the project reference set in the IDE?

Thanks,

Philip
 
P

Patrick Steele

My question is that the project references screen displays the
absolute path to these assemblies on my computer. When I deploy these
assemblies using multiple MSI installpacks their locations may change
(depending on where the user choose to install them). Is my container
going to find these DLLs on the deployment machine and use them OK?

It depends. If the assemblies are stored in the Global Assembly Cache
(GAC), then yes, your app should find them. Otherwise, they need to be
either in the same directory as your EXE or in one of the "probing
paths" defined in your app.config file.
Is there a way to load a reference dynamically in the code and use a
form on the fly without having the project reference set in the IDE?

Look into reflection. Specifically, Assembly.Load and
Activator.CreateInstance.
 

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