Question

I have a small .NET component, exposing COM interface to legacy clients. The interface itself is very simple (4 methods) and parameters are all of simple types (strings, ints, etc.). The component internally uses a web service - added as service reference - which exposes large set of classes. When I generate COM type library from my component, all the types from the web service make it in - even though there is no need for it. What do I need to do to prevent that from happening? Can I somehow mark everything from the web service I'm consuming as private?

Was it helpful?

Solution

Exposing COM components is a pain, is your entire project comvisible? I would recommend not marking it comvisible then explicitly marking each class you want exposed with the comvisible (true) attribute. I believe the first link is your exact issue.

A couple references you can look at:

How to elegantly prevent a webservice proxy from being exposed to COM?

Why is marking an assembly ComVisible(true) discouraged?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top