文件名称:WCF中动态设置KnownType的示例代码
文件大小:145KB
文件格式:ZIP
更新时间:2015-02-28 11:04:06
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
----WCFServices.Interfaces()
--------Properties()
--------IService1.cs(865B)
--------WCFServices.Interfaces.csproj(3KB)
--------obj()
--------bin()
----DataModel()
--------Class1.cs(3KB)
--------IDataAccessInfo.cs(297B)
--------Properties()
--------Class2.cs(3KB)
--------DataModel.Core.csproj(2KB)
--------obj()
--------bin()
----ConsoleApplication1()
--------Program.cs(838B)
--------WCF.Client.csproj(3KB)
--------app.config(1KB)
--------Service References()
--------Properties()
--------obj()
--------bin()
----DataModel.Extend()
--------Implement.cs(713B)
--------Properties()
--------DataModel.Extend.csproj(3KB)
--------obj()
--------bin()
----WcfService1()
--------WcfService1.csproj.user(1KB)
--------Web.Release.config(343B)
--------Properties()
--------Web.Debug.config(247B)
--------Service1.svc(108B)
--------Service1.svc.cs(721B)
--------obj()
--------App_Data()
--------bin()
--------Web.config(960B)
--------WcfService1.csproj(5KB)
----WcfService1.suo(174KB)
----WcfService1.sln(6KB)