我正在连接到Web服务。生成类时,它将创建两个相同的属性,一个System.CodeDom.Compiler.GeneratedCodeAttribute属性为“System.Xml”,一个具有System.Runtime.Serialization的System.CodeDom.Compiler.GeneratedCodeAttribute属性”。自动生成的类的从Web服务生成两次相同的属性
例子:
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] [System.Runtime.Serialization.DataContractAttribute(Name="CountryCode", Namespace="http://schemas.datacontract.org/2004/07/")] public enum CountryCode : int
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.18408")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.datacontract.org/2004/07/")] public enum CountryCode
因为这个解决方案将无法编译,给我的错误:
CS0101:命名空间“TAP”已经包含了“COUNTRYCODE的定义'
任何想法将不胜感激。
如何连接到Web服务?什么是Web服务相关的代码? – Szymon