G
Guest
Hello,
I'm confused about WHEN to load assemblies dynamically. While I was studying
my Win MCTS I did some practice with small pieces of code, but not
understanding the WHAT FOR concept for it all: I will explain my little
problem:
I'm developing a little network app (APP1) that will be used by different
kind of users; some of them will be using additional functions contained in
another tiny assembly class library (DLL1), others not.
DLL1 itself, has a reference to a COM component installed on SOME PCs (not
all).
I started to put code on APP1 to load DLL1 dynamically with
"Assembly.LoadFrom(myAssemblyPath)"... and so on.
Why I thought doing this ? ...
*** First, I thought that if I added a reference for DLL1 into my APP1
project, and I run APP1 on a client pc that does not have that COM component
installed, initially, APP1 would crash.
But now I think this is false, as if the user for a client pc does cannot
use the functions contained in the DLL1 (controlled by simple program flow)
the program will not crash ... Is it true ?
*** Second, I thought that doing that load dynamically will make the
application more lightweight in case the user does not use the functions
contained in DLL1, but this is not worth it to program this way as it is more
painful than having intellisense if I add a reference for DLL1 into APP1....
Am I wrong?
So, what is for, all this dynamically DLL loading hell? 8-D
The only thing I can imagine now is when you cannot know in advance where
the DLL will be, or worse, which methods will contain.
But in a stable and not too big development, maybe I don't have the need to
use it in my case...
I hope not being tooooo far from understanding the reasons for dynamically
loaded code.
Thanks in advance,
I'm confused about WHEN to load assemblies dynamically. While I was studying
my Win MCTS I did some practice with small pieces of code, but not
understanding the WHAT FOR concept for it all: I will explain my little
problem:
I'm developing a little network app (APP1) that will be used by different
kind of users; some of them will be using additional functions contained in
another tiny assembly class library (DLL1), others not.
DLL1 itself, has a reference to a COM component installed on SOME PCs (not
all).
I started to put code on APP1 to load DLL1 dynamically with
"Assembly.LoadFrom(myAssemblyPath)"... and so on.
Why I thought doing this ? ...
*** First, I thought that if I added a reference for DLL1 into my APP1
project, and I run APP1 on a client pc that does not have that COM component
installed, initially, APP1 would crash.
But now I think this is false, as if the user for a client pc does cannot
use the functions contained in the DLL1 (controlled by simple program flow)
the program will not crash ... Is it true ?
*** Second, I thought that doing that load dynamically will make the
application more lightweight in case the user does not use the functions
contained in DLL1, but this is not worth it to program this way as it is more
painful than having intellisense if I add a reference for DLL1 into APP1....
Am I wrong?
So, what is for, all this dynamically DLL loading hell? 8-D
The only thing I can imagine now is when you cannot know in advance where
the DLL will be, or worse, which methods will contain.
But in a stable and not too big development, maybe I don't have the need to
use it in my case...
I hope not being tooooo far from understanding the reasons for dynamically
loaded code.
Thanks in advance,