COM callable assembly in Visual Basic .NET


Author
Message
Tim Dol
Tim Dol
StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
I created a StrataFrame Business Object Library which includes 4 or 5 business objects. I need to be able to call this DLL from VB6. I clicked on 'Make Assembly COM-Visible' in the project properties.

I'm not clear on what I have to do next. Do I need to register the DLL if I don't plan to copy to the GAC to be able to use it with VB6?  I was able to reference the DLL and access no problem within the VB6 development environment but someone told me I needed to 'sign' the assembly with a 'strong name.  (If so, can you provide some guidance on how to do this).

Thanks

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
to 'sign' the assembly with a 'strong name. 

You only need to do this if you are going to place the assembly in the GAC.  I do not recommend doing this if you are going to make the DLL COM-Enabled.  To make your assembly properly accessible via VB6, you may need to create a TLB and update the registry.  You cannot self register a .NET DLL like you could in previous languages.  You will need to call the REGASM tool from the Visual Studio 2005 Command Prompt.  This will create your TLB and register the assembly. 

During the installation you can manually add the keys to the registry to make the COM visible on the workstation.

REGASM

regasm "c:\My Assembly Folder\MyAssembly.dll" /tlb:"c:\My Output Folder\MyAssembly.tlb"

FYI, to sign your assembly for strong-typing so it can be added to the GAC, just right-click on the project and go to the project properties.  Select the Signing tab.  Place a check mar in the "Sign the assembly" check box and create a new pfx file.  Rebuild the assembly and you will then be able to add it to the GAC.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search