我有一个工作流,该工作流为基础组件(DAL实现,电子邮件发件人等)提供了一些参数.它还具有WCF数据协定和其他可序列化的参数.我需要坚持并卸载此工作流程,然后稍后再继续.
I have a workflow that has some arguments for underlying components (DAL implementation, email sender etc). It also has a WCF data contract and other serializable arguments. I need to persist and unload this workflow and then resume later on.
它抛出异常是因为它试图序列化并持久化所有工作流参数.有没有办法让序列化程序仅保留那些可以序列化的参数?
It is throwing an exception because it is trying to serialize and persist all the workflow arguments. Is there a way to get the serializer to persist only those arguments that can be serialized?
推荐答案
Rory,
有可能;)
您唯一无法更改的代码是您的类,这些类无法持久.将NonSerialized服装添加到无法持久的元素上:
the only code you have ot change is your class that can't persiste. Add the NonSerialized attibut on elements that can't persist:
msdn.microsoft/en-us/library/system.nonserializedattribute .aspx
更多推荐
如何使用不可序列化的参数持久化工作流程
发布评论