0

I am getting following error in sharepoint Logs for my SharePoint Visual Studio Sequential workflow having a custom activity.

The custom activity is created through Component Class.

I am not sure why this error is coming? Please help!!!

System.Workflow.Runtime.Hosting.PersistenceException: Type 'System.ComponentModel.Container' in Assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable. ---> System.Runtime.Serialization.SerializationException: Type 'System.ComponentModel.Container' in Assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 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.Binary.WriteObjectInf... 3d93366f-a701-476c-91c9-d2153911486b
03/22/2012 12:38:36.31* w3wp.exe (0x049C)                           0x1620  SharePoint Foundation           Workflow Infrastructure         98d4    Unexpected  ...o.InitSerialize(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.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph)     at System.Workflow.ComponentModel.Activity.Save(Stream stream, IFormatter formatter)     at System.Workflow.Runtime.Hosting.WorkflowPersistenceService.GetDefaultSerializedForm(Ac...  3d93366f-a701-476c-91c9-d2153911486b
03/22/2012 12:38:36.31* w3wp.exe (0x049C)                           0x1620  SharePoint Foundation           Workflow Infrastructure         98d4    Unexpected  ...tivity 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.Workflow.Runtime.WorkflowExecutor.ProtectedPersist(Boolean unlock)  3d93366f-a701-476c-91c9-d2153911486b

Thanks!

Pankaj
  • 11
  • 2

2 Answers2

1

The Issue was because when i changed the Component class to Sequential Activity I had Activity properties e.g. 'A' & 'B'. Then i added this activity to VS toolbox. At this stage it was working fine.

Now when I changed the activity code to change its property to 'A' & 'C' and i also removed a Constructor having parameter as 'Container' object.

When i re-compiled this Activity and refresh its DLL. In workflow designer the Activity was not getting refreshed i.e. its toolbox was still pointing to old dll.

To Resolve for this i closes and opened the VS again, VOILA the designer is now getting updated Activity with new properties.

This was i think was limitation of VS toolbox that it is not getting refreshed in-spite of dll for that activity is updated.

Thanks!

Pankaj
  • 11
  • 2
0

Can you access the source XAML for the workflow? See if a "Container" object is being included, and if it's necessary to have it there. If you can remove it and still have the workflow run properly, this may fix the issue.