Hide web service in COM interop assembly

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?
 
G

Guest

change the scope of the class by hand to friend instead of public

regards

Michel Posseth
 
N

Nathan

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.
 
N

Nathan

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.
 

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

Similar Threads


Top