http://puu.sh/g3Yv8/3e8f11c975.png所以我添加了缺失的行,现在它可以正常工作了.[ClassInterface(ClassInterfaceType.None)][ComSourceInterfaces(typeof(Procesos.Iclass1))]公共部分类 CrSeedClient或者您可以编辑参考文件手动查找文件http://puu.sh/g3YzU/8523948580.png也许是我的错,称之为菜鸟错误,我不确定I was making a program suite to connect to a remote server and send some information via WSDL, this was sucessful and working correctly, but i was ordered to port all my programs into DLL's, i had to enable COM interop and make some returns, most of my programs went fine, until i found this error in one of my programs who use two proxy classes made from a WSDL, i have spend a whole week reading on the web details, but i can't understand how to fix it, this is the errorWarning 1 Type library exporter warning processing 'Tarea.CrSeedService.CrSeedClient, Tarea'. 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. TareaThis is one of the proxy classes who gets the errorhttp://pastebin.com/y1zFfzERand this is the reference.cs file of the Service Referencehttp://pastebin.com/vJuFZqsdinb4 some people report this question as duplicated I have readed Is it possible to implement a COM interface with a .NET generics class?but still didn't get itif you see the pastebin i added already in all the classes definitions on the proxy cs file the following[ClassInterface(ClassInterfaceType.None)][ComSourceInterfaces(typeof(Procesos.Iclass1))]where [ComVisible(true)] public interface Iclass1 { string Ejecucion(string cn, string speed); }where assemblyinfo.cs [assembly: ComVisible(true)]What should i do?What am i doing wrong?I would appreciate some guidance, VS2013 can't guide me exactly on where is the erroralthough it manually says its "CrSeedService.CrSeedClient" i have added the definitions and still outputs the mistake.[System.Diagnostics.DebuggerStepThroughAttribute()][System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")][ClassInterface(ClassInterfaceType.None)][ComSourceInterfaces(typeof(Procesos.Iclass1))]public partial class CrSeedClient : System.ServiceModel.ClientBase<Tarea.CrSeedService.CrSeed>, Tarea.CrSeedService.CrSeed{blah}Regards 解决方案 I can't find the file reference.cs in my Solution Explorer, yet i can get into it via Search function (searching "class CrSeedClient")http://puu.sh/g3Yv8/3e8f11c975.pngSo I've added the missing lines and now it's working properly.[ClassInterface(ClassInterfaceType.None)][ComSourceInterfaces(typeof(Procesos.Iclass1))]public partial class CrSeedClientAlternatively you can edit the reference file finding the file manuallyhttp://puu.sh/g3YzU/8523948580.pngmaybe it's my fault, call it a rookie mistake, im not sure 这篇关于警告:类型库导出器遇到了从泛型类派生的类型并且未标记为 [ClassInterface(ClassInterfaceType.None)]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-22 20:46
查看更多