Strong Names, GAC and a whole bunch of headaches.

P

Peter

I wrote my first VB.net class that doesn't suck and I want to allow
local users on my network use it in their MS Office Applications.
From what I've read I have to assign a strong name and then insert the
name into the gac. Here is where I get lost.

Is there a way to do this using the VB.net Setup Installer?

Or do I have to do it manually?

IE.
Ok I have test.dll and I want to assign it a strong name.
Do I just go sn.ex "ProgramPath/Name.dll"
and then gac.exe "ProgramPath/Name.dll"
 
M

Mattias Sjögren

Is there a way to do this using the VB.net Setup Installer?

It supports installing assemblies in the GAC, yes.

Ok I have test.dll and I want to assign it a strong name.
Do I just go sn.ex "ProgramPath/Name.dll"

Strong naming is usually done at compile time with the AssemblyKeyFile
or AssemblyKeyName attributes, not with Sn.exe (unless you use delay
signing).



Mattias
 
P

Peter

This is what I found:
Com Setup for DLL

VB.NET:

Create a key for the identifying originating system & Network. (Used
to make strong name.)
Sn.exe –k c:\MyKeyName.snk

Then in the assembly add:

<Assembly: AssemblyKeyFile( "c:\MyKeyName.snk")>
and your Title, Description, Co….. in seperate lines.
IE. <Assembly....
<Assembly....


Be sure to go into the project properties and select CONFIGURATION
PROPERTIES
Then select Register For COM InterOP

Build/Compile


Next Use the windows installer:

Add folder GAC to setup Project.

Import the DLL into the Application path and then the GAC

Change the Switch to COM



Import into Access or NET Application:

Set Reference, Select TBL file for the component found in your
installation app directory (MS Access) or DLL under add Reference in
..NET.

Access Syntax:

Dim myDll as yourdllname.ClassName
Dim Mystring (or whatever) as string
Mystring = MyDll.method()

In additon to this you may want to add an alias to reference the DLL.
This will allow you to see the interworking methods and properties of
your class.
 

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