Sharepoint 工作流反串行化问题
运行这段代码时,
XmlSerializer xs = new XmlSerializer(typeof(Init));
XmlTextReader xtr = new XmlTextReader(new System.IO.StringReader(workflowProperties.InitiationData));
Init init = (Init)xs.Deserialize(xtr);
报了这个错:
System.ArgumentNullException was unhandled by user code
Message="Value cannot be null.\r\nParameter name: s"
Source="mscorlib"
ParamName="s"
StackTrace:
at System.IO.StringReader..ctor(String s)
at TestWorkFlow.Workflow1.onWorkflowActivated1_Invoked(Object sender, ExternalDataEventArgs e)
at System.Workflow.ComponentModel.Activity.RaiseGenericEvent[T](DependencyProperty dependencyEvent, Object sender, T e)
at System.Workflow.Activities.HandleExternalEventActivity.RaiseEvent(Object[] args)
at System.Workflow.Activities.HandleExternalEventActivity.Execute(ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
InnerException:
求高手指点~~
[解决办法]
workflowProperties.InitiationData的值是什么,从错误表面看这个值是null。你可以用VS调试一下看看。或者提供更详细的信息