0
votes

I want to call a WCF Service which is implemented as a generic class. Note: [I have completely no access to modify its classes either to marks it COM visible or to make it as non generic class etc].

I have write a client which consumes that WCF Service. I get warning that:

"Type library exporter warning processing 'WCFService.MultiService.LokUpServiceClient, WCFService'. Warning: Type library exporter encountered a type that derives from a generic class and is not marked as [ClassInterface(ClassInterfaceType.None)]. Class interfaces cannot be exposed for such types. Consider marking the type with [ClassInterface(ClassInterfaceType.None)] and exposing an explicit interface as the default interface to COM using the ComDefaultInterface attribute".

Question: To make WCF client COM visible by consuming perfectly WCF Service?
How to get rid of this warning message?

2
At the moment of adding a service reference have you tried deselecting the option of Reusing existing types?ian_scho
Thanks. Its works.Lets Do Green
@ian_scho: Could you make this an answer?FH-Inway

2 Answers

1
votes

At the moment of adding a service reference try deselecting the option of Reusing existing types.

Reuse types in referenced assemblies

0
votes

+1 to the accepted answer. I just want to add that if you've already configured a service reference, you can change the Reuse types... setting for the service reference as follows:

  1. In the Solution Explorer, find the service reference. It should appear under a Connected Services or Web Services section.
  2. Right-click the service reference and click Configure Service Reference. A Settings dialog box appears.
  3. Clear the Reuse types in referenced assemblies check box.
  4. Click OK.