【问题标题】:Failure compiling Workflow Definition编译工作流定义失败
【发布时间】: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


    【解决方案1】:

    发现问题。在 4.5 框架和工作流编译器不知道这一点之后,使用假/外观程序集的 PCL 库重定向到 mscorlib。

    在 MS Connect 上查看此问题,那里有一个解决方法:

    http://connect.microsoft.com/VisualStudio/feedback/details/800070/pcl-reference-in-a-workflow-project-destroys-intellisense

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-05-28
      • 2016-01-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多