Home All Groups Group Topic Archive Search About

Hide web service in COM interop assembly

Author
28 Jun 2006 9:49 AM
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?

Author
28 Jun 2006 11:46 AM
M. Posseth
change the scope of the class by hand to friend instead of public

regards

Michel Posseth 

Show quoteHide quote
"Nathan" wrote:

> 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?
>
>
Author
28 Jun 2006 12:05 PM
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.
Author
29 Jun 2006 12:13 PM
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.