我在具有自定义活动的sharepoint Visual Studio顺序工作流的SharePoint日志中收到以下错误。
自定义活动是通过Component Class创建的。
我不确定为什么会出现这个错误?请帮帮我!
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
谢谢!
发布于 2012-03-24 13:42:20
问题是因为当我将Component类更改为Sequential Activity时,我具有Activity属性,例如'A‘和'B’。然后,我将此活动添加到VS工具箱。在这个阶段,它工作得很好。
现在,当我更改活动代码以将其属性更改为'A‘和'C’时,我还删除了一个带有参数的构造器作为'Container‘对象。
当我重新编译这个活动并刷新它的DLL时。在工作流设计器中,活动未刷新,即其工具箱仍指向旧的dll。
为了解决这个问题,我关闭并再次打开了VS,瞧,设计器现在得到了具有新属性的。
我认为这是VS工具箱的局限性,它没有得到刷新-尽管dll的活动是更新的。
谢谢!
发布于 2012-03-24 07:17:21
您是否可以访问工作流的源XAML?查看是否包含"Container“对象,以及是否有必要将其包含在其中。如果您可以将其删除,但仍能使工作流正常运行,则可能会解决此问题。
https://stackoverflow.com/questions/9841249
复制相似问题