當我運行Service.svc文件時出現奇怪的錯誤: 我已經使用一個類(來自另一個Webservice)作爲該函數的參數。 如果我在界面中評論這個函數,它的工作正常。序列化錯誤當使用WebService類作爲參數WCF
Type cannot inherit from a type that is not marked with DataContractAttribute or SerializableAttribute. Consider marking the base type with DataContractAttribute or SerializableAttribute, or removing them from the derived type.
有人可以幫我解決這個問題。
thans在提前和 對不起,我的英語不好。
你有權訪問基類型嗎? –
是的,但基類型沒有用DataContractAttribute或SerializableAttribute標記,因爲它們來自web服務。 – amaz
你可能是否混合了Web服務(將會有xml標記)和服務引用(它們會有dcs標記)?另外:在不同的網絡服務之間混合使用類型是一個糟糕的主意,如果這就是你在做什麼 –