Using a C# Class Library with VB6

L

lord.torall

I hope I'm posting this in the right place....

I have a new C# class library written in Visual Studio 2008. I also
have an existing VB6 application that I have been maintaining for some
time.

In the configuration of the class library I have enabled "Make
assemble COM-Visible" and "Register for COM interop"

When I build the class library on my development machine I am able to
see and reference it from my VB6 application as I do many other dlls.
However, I am having a real headache when it comes to deploying my
application. I usualy build my MSI using InstallShield and have added
the dll and it's associated tlb to the package. However when I attempt
to run the released application on a test machine it fails with an
error 429. If I run the application in debug mode, if breaks the first
time it attempts to reference anything to do with my new class
library.

Can anyone give me some pointers as to what I should be doing in order
to run my application on anything other than my development machine?
 
P

Peter Ritchie [C# MVP]

Have you registered the VB6 runtime and used regasm on the C# class library?
 
R

Rob Windsor

I hope I'm posting this in the right place....

I have a new C# class library written in Visual Studio 2008. I also
have an existing VB6 application that I have been maintaining for some
time.

In the configuration of the class library I have enabled "Make
assemble COM-Visible" and "Register for COM interop"

When I build the class library on my development machine I am able to
see and reference it from my VB6 application as I do many other dlls.
However, I am having a real headache when it comes to deploying my
application. I usualy build my MSI using InstallShield and have added
the dll and it's associated tlb to the package. However when I attempt
to run the released application on a test machine it fails with an
error 429. If I run the application in debug mode, if breaks the first
time it attempts to reference anything to do with my new class
library.

Can anyone give me some pointers as to what I should be doing in order
to run my application on anything other than my development machine?

First off, you need to make sure to assign GUIDs correctly on your
class and on your interfaces. Then, you need to make sure to register
your assembly after you've deployed using regasm.exe.

This article should help

http://msdn2.microsoft.com/en-us/library/c3fd4a20.aspx
 

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