0

我在具有自定義活動的SharePoint Visual Studio順序工作流的SharePoint日誌中收到以下錯誤。「System.Workflow.Runtime.Hosting.PersistenceException」自定義SharePoint順序工作流程

自定義活動通過組件類創建。

我不知道爲什麼會出現這個錯誤?請幫忙!!!

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 

謝謝!

回答

0

您可以訪問工作流的源XAML嗎?查看是否包含「Container」對象,以及是否有必要在其中包含該對象。如果您可以將其刪除並使工作流程正常運行,則可以解決問題。

0

問題是因爲當我將組件類更改爲順序活動時,我有活動屬性,例如'A'&'B'。然後我將這個活動添加到VS工具箱。在這個階段它工作得很好。

現在,當我更改活動代碼以將其屬性更改爲'A'&'C'時,我還刪除了一個具有參數'Container'對象的構造函數。

當我重新編譯這個活動並刷新它的DLL。在工作流設計器中,Activity沒有被刷新,即它的工具箱仍然指向老的dll。

解決爲此我關閉並再次打開VS,VOILA設計師現在正在更新活動與新屬性。

這是我認爲是VS工具箱的限制,它不會刷新,儘管該DLL的活動更新。

謝謝!