Click to See Complete Forum and Search --> : Plug Ins


NV2002
December 28th, 2002, 09:40 AM
Hi All,

I am new to VB.net. It seems like a language with allot of power.
I am trying to write an application that will use a plug in. I thought by creating a 'StandAlone' DLL with all of the code I wish to change at runtime and just change it at will.

Well it turns out that if I make an application with a DLL and compile it all is well. Now if I change the code in the DLL and try to run the already compiled program ( which had the first DLL
compilied along with it ) I get an ERROR!.

So I have learned that even though I may complile code into a DLL alone it will NOT work with the the SAME NAME DLL with
new code added.

You see I would like to change a FORM at runtime. The DLL code
will have STANDARD functions to be called by the MAIN FORM
but I would like to CHANGE the CODE or ADD to it after the
original program has been installed and run on a machine.

I have though of a SCRIPT method but don't want to write and
interperter to run the script.

I hope you understand the question. Is it possible to write a VBASIC application and install it on a PC then just swap in and out a SAME named DLL with different code to alter how the program works.

It seems that VBASIC marks the DLL and knows when it is different when the MAIN program was compilied even when
the CODE in the DLL is the same.

How do you make a program run OTHER code after it is compilied.
Like you can ADD PLUG-INS rto COREL etc..

Thanks in advance for your help

Nick

TheCPUWizard
December 28th, 2002, 09:49 AM
.NET adds naming information to each assembly. This is to prevent accidental use of the wrong DLL that happens to have the same name.

The solution is to make sure you set a "Strong Name" for the DLL.

Hope this helps..

NV2002
December 28th, 2002, 05:47 PM
Hi CpuWizard,

Would you happen to have a CODE snippet for this ?
Or do you know of some EXAMPLE source code on the web of this method being used ? I would be very grateful for your help.
How do you assign the STRONG NAME in code ?

Is it in the <Assembly file in the DLL being compilied or the main program that will use it or both ? I figured it could be done I just need a simple example to get me started.

Thank You,

Nick