0

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?

ChrisH
  • 23
  • 1
  • 5
  • [WebMethod] attribute sounds like what you are wanting to mark or not mark, if you don't want to expose the other methods declare them as Private – MethodMan Aug 21 '12 at 23:29

1 Answers1

0

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?

Community
  • 1
  • 1
Rob4md
  • 194
  • 4
  • Of course - thanks! Now that I know how comvisible works, I'm sure I won't have to use on any other project ;). – ChrisH Aug 22 '12 at 03:14