Hide web service in COM interop assembly

  • Thread starter Thread starter Nathan
  • Start date Start date
N

Nathan

I have a .Net assembly that exposes functionality to COM through the
use of a ComClass.

The assembly is installed using an MSI which automatically registers
the assembly for COM interop.

My problem is that when a user views the assembly through object
browser, the automatically generated classes connected with a web
service appear.

I've set the assembly to have ComVisible(False) but this doesn't seem
to have any effect, the only thing that does is by me added
ComVisible(False) to the generated classes but of course if the web
reference is updated these disappear.

Does anybody have any ideas about a better way for me to hide the
generated web service classes?
 
Surely I'll have the same issue as with the ComVisible in that if the
web reference is updated the classes will all be recreated thus loosing
the change?

The other thing is that there are 25 classes being exposed through the
web reference and ideally I'd like to try and find a solution that
doesn't require me to alter all the classes by hand.
 
I found a solution.

I'd turned off register for COM Interop so no tlb created as I believed
I could do this through an installation but turns out thats not a good
idea.

Once I'd applied ComVisible(false) to all the .Net classes and the
assembly and then turned on register for COM Interop the tlb that was
created only contained the definition for the single COM class.
 
Back
Top