我正在連接到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