开发者

TypeBuilder with DataContract and DataMembers

I'm generating a dynamic type on the fly with a DataContract attribute and DataMembers. I've verified the type is getting generated correctly with DataContract and DataMember attributes using reflection on the generated type.开发者_运维技巧

I then generate a ServiceContract type on the fly that includes operation with said types.

However, when I add a ServiceReference from the client, my DataContract types get generated with the client with no properties/DataMembers.

Any idea what's going wrong here?

Thanks.


Answer Here:

http://www.netframeworkdev.com/windows-communication-foundation/datacontractserializer-not-serializingdeserializing-type-built-with-typebuilder-65973.shtml

My TypeBuilder properties' methods were marked with MethodAttributes.Virtual.

Another great well documented feature of the DataContractSerializer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜