本文介绍了如何使用不可序列化的参数持久化工作流程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个工作流,该工作流为基础组件(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?

推荐答案

有可能;)

您唯一无法更改的代码是您的类,这些类无法持久.将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:

http://msdn.microsoft.com/en-us/library/system.nonserializedattribute .aspx


这篇关于如何使用不可序列化的参数持久化工作流程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 04:25