SPUser 未标记为可序列化
我有一个奇怪的。我尝试使用以下内容分配工作流任务:
private void createBookingTask_MethodInvoking(object sender, EventArgs e)
{
createBookingTask_TaskId = Guid.NewGuid();
createBookingTask_TaskProperties.Title = "New HFSC Booking";
createBookingTask_TaskProperties.AssignedTo = @"NET\352488"
createBookingTask_TaskProperties.DueDate = DateTime.Now.AddDays(7);
createBookingTask_TaskProperties.TaskType = 1;
}
OnTaskChanged 活动的事件处理程序不包含任何代码。 Visual Studio 调试器已连接并且没有出现异常。在此之前提交任务的 InfoPath 表单需要很长时间,从而导致此工作流错误。上面的代码用于工作流程的第二个任务。第一个任务很有魅力。如果我不包含 OnTaskChanged 活动,第二个就可以工作。如果禁用此活动,工作流程将顺利运行并完成。这两个任务的 OnTaskChanged 事件处理程序不包含任何代码。如果第二个任务 OnTaskChanged 活动未禁用,那么我会收到工作流程错误以及 12/LOGS 中的以下条目:
System.Workflow.Runtime.Hosting.PersistenceException: 在中键入“Microsoft.SharePoint.SPUser” 程序集'Microsoft.SharePoint, 版本=12.0.0.0,文化=中立, PublicKeyToken=71e9bce111e9429c' 是 未标记为可序列化。 ---> System.Runtime.Serialization.SerializationException: 在中键入“Microsoft.SharePoint.SPUser” 程序集'Microsoft.SharePoint, 版本=12.0.0.0,文化=中立, PublicKeyToken=71e9bce111e9429c' 是 未标记为可序列化。
第二个任务的活动设置与第一个任务的活动完全相同。创建任务-> OnTaskChanged ->;完成任务。只是 OnTaskChanged 似乎破坏了工作流程,但仅限于以相同方式设置的第二个任务。
I've got a strange one. I'm trying to assign a workflow task using the following:
private void createBookingTask_MethodInvoking(object sender, EventArgs e)
{
createBookingTask_TaskId = Guid.NewGuid();
createBookingTask_TaskProperties.Title = "New HFSC Booking";
createBookingTask_TaskProperties.AssignedTo = @"NET\352488"
createBookingTask_TaskProperties.DueDate = DateTime.Now.AddDays(7);
createBookingTask_TaskProperties.TaskType = 1;
}
The event handler for the OnTaskChanged activity contains no code. Visual Studio debugger is attached and doesn't get an exception. Submitting the InfoPath form for the task before this one takes a long time resulting in this workflow error. The code above is for the second task of a workflow. The first task works a charm. This second one works provided I don't include the OnTaskChanged activity. If this activity is disabled the the workflow will run and complete happily. The OnTaskChanged event handler for both tasks contain no code. If this second tasks OnTaskChanged activity isn't disabled then I receive a Workflow Error and the following entry in 12/LOGS:
System.Workflow.Runtime.Hosting.PersistenceException:
Type 'Microsoft.SharePoint.SPUser' in
Assembly 'Microsoft.SharePoint,
Version=12.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c' is
not marked as serializable. --->
System.Runtime.Serialization.SerializationException:
Type 'Microsoft.SharePoint.SPUser' in
Assembly 'Microsoft.SharePoint,
Version=12.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c' is
not marked as serializable.
The activities for the second task are set up exactly the same as for the first task. CreateTask -> OnTaskChanged -> CompleteTask. It's just the OnTaskChanged seems to break the workflow but only for this second task that's setup in just the same way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否在工作流程本身中存储了 SPUser 类型的任何变量?
Are you storing any variables in the WorkFlow itself that are of type SPUser?