【问题标题】:WF4 hosted in IIS not persisting托管在 IIS 中的 WF4 不持久
【发布时间】:2013-06-11 20:48:06
【问题描述】:

我有一个托管在 IIS 中的 WF4 状态机工作流。我正在尝试添加持久性并将以下内容添加到 web.config。

<behaviors>
    <behavior>
        <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>

    <behavior name="WorkflowPersistence">
          <sqlWorkflowInstanceStore
                  connectionString="Data Source=.\SQLExpress;Initial Catalog=InstanceStore;Integrated Security=True;Async=true"
                  instanceEncodingOption="GZip"
                  instanceCompletionAction="DeleteAll"
                  instanceLockedExceptionAction="AggressiveRetry"
                  hostLockRenewalPeriod="00:00:30"
                  runnableInstancesDetectionPeriod="00:00:05" />

          <workflowIdle timeToPersist="00:00:05" timeToUnload="00:00:30"/>
    </behavior>
</behaviors>

我还在工作流初始操作的 SendReplyToReceive 上将 PeristBeforeSend 属性设置为 true。调用初始操作后,InstancesTable 中不会保留任何内容。我也让工作流闲置,也没有任何东西被保留。事件日志中没有异常或条目。所有服务操作都运行良好。我可以从头到尾运行工作流而不会出错。

我还将连接字符串中的数据源属性的值设置为我知道在尝试连接时获取 Sql 异常是无效的,但仍然没有。所以它要么在默默地失败方面做得很好,要么持久性根本没有触发。我可能遗漏了一些简单的东西 - 有什么想法吗?

【问题讨论】:

    标签: iis workflow-foundation-4


    【解决方案1】:

    问题在于 Behaviors 集合中的额外 Behavior 元素。我删除了第二个 Behavior(名为 WorkflowPersistence)并将其内容放在第一个 Behavior 中。然后持久性开始起作用了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多