0

对于具有自定义活动的 SharePoint Visual Studio 顺序工作流,我在共享点日志中收到以下错误。

自定义活动是通过组件类创建的。

我不确定为什么会出现这个错误?请帮忙!!!

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

谢谢!

4

2 回答 2

1

问题是因为当我将组件类更改为顺序活动时,我有活动属性,例如“A”和“B”。然后我将此活动添加到 VS 工具箱。在这个阶段它工作正常。

现在,当我更改活动代码以将其属性更改为“A”和“C”时,我还删除了一个具有参数为“容器”对象的构造函数。

当我重新编译此活动并刷新其 DLL 时。在工作流设计器中,Activity 没有被刷新,即它的工具箱仍然指向旧的 dll。

为了解决这个问题,我关闭并再次打开 VS,VOILA 设计师现在正在使用新属性获取更新的 Activity。

这是我认为是 VS 工具箱的限制,尽管更新了 dll,但它没有被刷新。

谢谢!

于 2012-03-24T05:42:20.463 回答
0

您可以访问工作流的源 XAML 吗?查看是否包含“容器”对象,以及是否有必要将它放在那里。如果您可以删除它并且仍然让工作流正常运行,这可能会解决问题。

于 2012-03-23T23:17:20.697 回答