开发者

SPUser is not marked as serializable

开发者 https://www.devze.com 2022-12-20 20:31 出处:网络
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)

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 Assem开发者_JAVA技巧bly '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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消