How to create COM in C# class lib ?

C

CYShao

My company have many release programs written VB6.0 before.
Now, we want to add new functionalities in C#, and relpece old VB6
programs step by step.
Obviously, COM is a good way to do that.

In my program, I just to write a COM with C#, and invok it BV6.0
But I really can't understand why C# doesn't support "COM class"
template.( VB.Net provides this.)

I just want to know how to create COM in C# class lib ,and invoke it in VB6.

Thank you very much:)

CYShao
 
F

fd123456

Hi Shao,

1) Your assembly must have a strong name. Go to the "AssemblyInfo.cs"
file, and change the [assembly: AssemblyTitle("")] to include the name
of your project, like [assembly: AssemblyTitle("NETtoCOM")].

2) Right-click on your project, select the "Common properties" tab,
select "Class Library" as output type.

3) Click on the "Configuration properties tab", and set "Register for
COM Interop" to True.

That should do it.

HTH,
Michel
 

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