[英]Serialization Error When using WebService class as parameter to WCF
運行Service.svc文件時出現奇怪的錯誤:我使用了一個類(來自另一個Webservice)作為該函數的參數。 如果我在Interface中評論該功能,則可以正常工作。
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.
有人可以幫我這個忙。
提前謝謝,抱歉我的英語不好。
我認為馬克(Marc)是正確的,也許是溝通不暢。 他/我認為您正在使用Web服務,並且正在重復使用同一Web服務(您可能為其生成了代碼)中的類作為正在編寫的其他WCF Web服務中的參數。
本質上,產生錯誤的類型可能沒有所需的DataContractAttribute。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.