WCF中动态设置KnownType的示例

时间:2015-02-28 10:54:18
【文件属性】:

文件名称:WCF中动态设置KnownType的示例

文件大小:144KB

文件格式:ZIP

更新时间:2015-02-28 10:54:18

DataContractResolver, WCF, Sample

动态配置Known Types,解决WCF动态扩展属性类型的问题: Unhandled Exception: System.Runtime.Serialization.SerializationException: Type '--------' with data contract name 'Dog:http://schemas.datacontract.org/2004/07/Serialization' is not expected. Consider using a DataContractResolver or 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.


【文件预览】:
WcfService1
----WcfService1.sln(6KB)
----WCFServices.Interfaces()
--------IService1.cs(865B)
--------obj()
--------bin()
--------WCFServices.Interfaces.csproj(3KB)
--------Properties()
----DataModel()
--------obj()
--------bin()
--------DataModel.Core.csproj(2KB)
--------IDataAccessInfo.cs(297B)
--------Class2.cs(3KB)
--------Class1.cs(3KB)
--------Properties()
----WcfService1.suo(156KB)
----DataModel.Extend()
--------Implement.cs(713B)
--------obj()
--------bin()
--------DataModel.Extend.csproj(3KB)
--------Properties()
----ConsoleApplication1()
--------Program.cs(838B)
--------app.config(1KB)
--------obj()
--------bin()
--------Service References()
--------WCF.Client.csproj(3KB)
--------Properties()
----WcfService1()
--------Service1.svc(108B)
--------App_Data()
--------obj()
--------bin()
--------Service1.svc.cs(721B)
--------Web.config(960B)
--------Web.Debug.config(247B)
--------WcfService1.csproj.user(1KB)
--------WcfService1.csproj(5KB)
--------Web.Release.config(343B)
--------Properties()

网友评论