You are receiving the error similar to the one below when attempting to execute a SharePoint WWF workflow.
======================================================================================
11/19/2009 10:52:19.18 w3wp.exe (0x17FC) 0x157C Windows SharePoint Services Workflow Infrastructure 88xr Unexpected WinWF Internal Error, terminating workflow Id# 86a35560-7bc3-4841-8a81-d8180d9b6f5c
11/19/2009 10:52:19.18 w3wp.exe (0x17FC) 0x157C Windows SharePoint Services Workflow Infrastructure 98d4 Unexpected System.Workflow.Runtime.Hosting.PersistenceException: Type ‘Microsoft.SharePoint.SPWeb’ 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.SPWeb’ in Assembly ‘Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’ is not marked as serializable. at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type) at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context) at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo() at System.Runtime.Serialization.Formatters.B…
11/19/2009 10:52:19.18* w3wp.exe (0x17FC) 0x157C Windows SharePoint Services Workflow Infrastructure 98d4 Unexpected …inary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) at System.Runtime.Serializati…
11/19/2009 10:52:19.18* w3wp.exe (0x17FC) 0x157C Windows SharePoint Services Workflow Infrastructure 98d4 Unexpected …on.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph) at System.Workflow.ComponentModel.Activity.Save(Stream stream, IFormatter formatter) at System.Workflow.ComponentModel.Activity.Save(Stream stream) at System.Workflow.Runtime.Hosting.WorkflowPersistenceService.GetDefaultSerializedForm(Activity activity) at Microsoft.SharePoint.Workflow.SPWinOePersistenceService.SaveWorkflowInstanceState(Activity instanceState, Boolean unlock) at System.Workflow.Runtime.WorkflowExecutor.Persist(Activity dynamicActivity, Boolean unlock, Boolean needsCompensation) — End of inner exception stack trace — at System.Workflow.Runtime.WorkflowExecutor.Persist(Activity dynamicActivity, Boolean unlock, Boolean needsCompensation) at System.Workf…
This error occurs when you have complex member objects in your C# or VB code that SharePoint can’t serialize. These objects, typically something like SPWeb or SPUser can’t be serialized so SharePoint throws this error, typically after first workflow task.
Do not create member (top level) variables in your workflow classes. For example, do not declare something like “SPWeb web = spWorkflowProperties.web”. Instead retrieve this information within each method.
In another example, I had attempted to create my own approvals class in one of my workflows that was a simple class that I had created with three properties. SharePoint didn’t let the workflow run past the first task until I had marked the approvals class as Serializable.
[Serializable]
public class Approvals{
…
}
Serialization Issue with Windows Workflow Foundation and Sharepoint Workflow, 8.7 out of 10 based on 7 ratings
Can you please elaborate on your solution for approvals? I sepent too many days trying to kick OOB 2010 approval with my calculated approvers in parallel and evry solution failed some where
