【发布时间】:2015-01-28 17:16:03
【问题描述】:
我在尝试从其定义中加载工作流时遇到以下错误:
Compilation failures occurred:
Line 0: Unable to load assembly 'PI.Shared.WF.Activities.Tests'. Line 581: The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Complete results are contained in the Data property of this exception. Please correct the errors in the source and retry the Load.
我的代码只是从 XAML 文件内容的 byte[] 内存流中加载它。
它应该怎么做?这个“PI.Shared.WF.Activities.Tests”项目只是我用来绘制工作流的类库。之后,文件本身被序列化为 byte[] 并保存在 azure 存储中。当我们需要加载它时,只需获取 byte[] 并传递给:
activity = ActivityXamlServices.Load(new MemoryStream(workflowDefinition.Definition), settings);
其中定义是带有文件数据的字节[]。
我应该错过什么? 'PI.Shared.WF.Activities.Tests' 甚至没有在工作流宿主应用程序中使用。
谢谢
【问题讨论】:
标签: c# .net workflow-foundation-4 workflow-foundation