[英]Type library exporter encountered a type that derives from a generic class
I want to call a WCF Service which is implemented as a generic class. 我想调用作为通用类实现的WCF服务。 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]. 注意:[我完全无权修改其类以将其标记为COM可见或使其成为非通用类,等等]。
I have write a client which consumes that WCF Service. 我已经写了一个使用该WCF服务的客户端。 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". “类型库导出程序警告处理'WCFService.MultiService.LokUpServiceClient,WCFService'。警告:类型库导出程序遇到了从通用类派生的类型,并且未标记为[ClassInterface(ClassInterfaceType.None)]。无法为考虑使用[ClassInterface(ClassInterfaceType.None)]标记类型,并使用ComDefaultInterface属性将显式接口公开为COM的默认接口。
Question: To make WCF client COM visible by consuming perfectly WCF Service? 问:通过完全使用WCF服务使WCF客户端COM可见?
How to get rid of this warning message? 如何摆脱这个警告信息?
+1 to the accepted answer. +1接受的答案。 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: 我只想补充一下,如果您已经配置了服务引用,则可以如下更改服务引用的“重用类型...”设置:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.