0

我正在尝试创建托管在 IIS 中的 Windows Workflow 4 服务。我已将服务配置如下

<system.serviceModel>
    <services>
        <service name="ApprovalService" behaviorConfiguration="ApprovalServiceBehavior">
        </service>
    </services>
    <behaviors>
        <serviceBehaviors>
            <behavior name="ApprovalServiceBehavior">
                <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
                <serviceMetadata httpGetEnabled="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" />
                <sqlWorkflowInstanceStore connectionStringName="WorkflowPersistence" />
                <workflowIdle timeToPersist="0" timeToUnload="0:05:0"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>

服务不坚持!服务中没有什么神奇的东西,比如自定义值的持久化等。我已经让它在另一个具有自定义持久化方法的服务中工作,但我无法弄清楚其中的区别。

也许我的服务出错了,但我似乎也不知道如何进行调试。

任何帮助将不胜感激!

4

1 回答 1

0

假设您的服务元素的名称和 SQL 连接字符串是正确的,您的工作流应该在它空闲时立即持续。您是否尝试添加延迟活动以确保其空闲或添加持久活动以强制其持续存在?

尝试添加跟踪或跟踪以查看发生了什么。就像是

<system.diagnostics>
  <sources>
    <source name="System.Activities"
            switchValue="Verbose">
      <listeners>
        <add name="textListener"
             type="System.Diagnostics.TextWriterTraceListener"
             initializeData="MyTraceLog.txt"
             traceOutputOptions="ProcessId, DateTime" />
      </listeners>
    </source>
  </sources>
</system.diagnostics>
于 2011-12-07T08:14:30.973 回答