SPUser 未标记为可序列化

发布于 2024-08-21 13:53:47 字数 1311 浏览 3 评论 0原文

我有一个奇怪的。我尝试使用以下内容分配工作流任务:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

软的没边 2024-08-28 13:53:47

您是否在工作流程本身中存储了 SPUser 类型的任何变量?

Are you storing any variables in the WorkFlow itself that are of type SPUser?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文