WCF 序列化 Type对象

现在我有一个方法:

public object Fetch(Type objectType){}

这个方法调用一个WCF的方法,并且把objectType作为参数传进去,

因为WCF不能很好的序列化Type类型,所以每次都是报错:

Type 'System.RuntimeType' with data contract name 'RuntimeType:http://schemas.datacontract.org/2004/07/System' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.

希望大家帮忙?怎么解决


慕慕森
浏览 360回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP