Remote COM server in C#?

I

Igor R.

Is the subj feasible?

More detailed question: I've got a WCF service, which must be accessed
from a remote application written in c++. I thought it would be much
simple, if all the objects in the service would be accessible as COM
objects as well.

Thanks.
 
P

Peter Duniho

Igor said:
Is the subj feasible?

More detailed question: I've got a WCF service, which must be accessed
from a remote application written in c++. I thought it would be much
simple, if all the objects in the service would be accessible as COM
objects as well.

Yes, you can write a COM server in C#. You'll need to import the COM
types (see tlbimp.exe) and register your assembly (see regasm.exe). See
".NET COM interop" for more details.

Pete
 
K

Kevin Stumpf

I had the same problem:

Wrote a local .NET COM Server that communicates with the WCF Server by the
common .NET build in features.
C++ apps only communicate with that COM Server by its public interface.

As easy as that.

BR,
Kevin
 
I

Igor R.

Thanks for your replies.
I know how to make an inproc (dll) COM server in C#. The problem is
that when I try to apply regasm to an exe, it says that no types were
registered.
 
K

Kevin Stumpf

Why do you need an application? Is a dll c# COM server not sufficient?

That COM Server is nothing more than a COM wrapper for the WCF server.

Kevin
 
I

Igor R.

Why do you need an application? Is a dll c# COM server not sufficient?
That COM Server is nothing more than a COM wrapper for the WCF server.

You mean that I have make another DLL that would expose all the
interfaces of the WCF server, and implement them by forwadring to the
WCF server? Well, for lack of any other option, that's what I'm doing
now, but it doubles the maintenance cost.
 
P

Peter Duniho

Igor said:
You mean that I have make another DLL that would expose all the
interfaces of the WCF server, and implement them by forwadring to the
WCF server? Well, for lack of any other option, that's what I'm doing
now, but it doubles the maintenance cost.

I don't really think that's necessary. You should look more closely at
why regasm.exe isn't finding anything to export. Maybe you've just
forgotten to enable COM visibility in the project settings, or something
else simple like that?

Pete
 

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