如何在WF4中使用DataContractResolver [英] How to use DataContractResolver in WF4
问题描述
我们正在以WF4方式开发工作流程。当我们使用一些自定义类时,我们必须将它们添加到每个发送/接收活动
中的knowntypes集合以避免序列化问题。我们有什么方法可以使用DataContractResolver功能,这是一个新的dotnet 4,以避免添加知识类型?或任何替代解决方案,如果任何人可以建议?谢谢。
Surender.NET
是的我认为这是可能的。您基本上可以在运行时使用新类型加载新程序集,然后只需要在使用DataContractResolver时获取更新类型信息到服务中:
http://msdn.microsoft.com/en-us/library/dd807504.aspx。
谢谢,
We are developing workflows in WF4 way. When we use some custom classes we have to add them to knowntypes collection in each send/receive activity to avoid serialization problems. Is there any way we can use DataContractResolver feature which is a new dotnet 4 to avoid adding knowntypes ? Or any alternate solution if any one can suggest ?? Thanks.
Surender.NET
Yes I think this is possible. You can basically load a new assembly at run time with the new types and then just need to have a way to get the updated type information into the service when using DataContractResolver: http://msdn.microsoft.com/en-us/library/dd807504.aspx.
Thanks,
这篇关于如何在WF4中使用DataContractResolver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!