代码之家  ›  专栏  ›  技术社区  ›  Matt Ruwe

从app.config文件配置Windows工作流

  •  1
  • Matt Ruwe  · 技术社区  · 16 年前

    我以前做过,所以我知道这是可能的,但我似乎记不清该如何准确地完成它。我需要从app.config中设置loadingInterval和instanceOwnershipDuration。有人能给我指个方向吗?我目前正在使用以下不起作用的内容:

        <Runtime>
      <CommonParameters>
        <add name="ConnectionString" value="*****"/>
      </CommonParameters>
      <Services>
        <!-- Persistence -->
        <add type="System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService, System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" UnloadOnIdle="true" InstanceOwnershipDuration="10" LoadingInterval="30" />
        <!-- Tracking -->
        <add type="System.Workflow.Runtime.Tracking.SqlTrackingService, System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" UseDefaultProfile="true"/>
        <!--Data Exchanges-->
        <add type="System.Workflow.Activities.ExternalDataExchangeService, System.Workflow.Activities, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" ConfigurationSection="Workflow/ExternalDataExchangeServices" />
        <!-- Default Workflow Scheduler-->
        <add type="System.Workflow.Runtime.Hosting.DefaultWorkflowSchedulerService, System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        <!-- Work Batch Service -->
        <add type="System.Workflow.Runtime.Hosting.SharedConnectionWorkflowCommitWorkBatchService, System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" EnableRetries="true" />
      </Services>
    </Runtime>
    
    1 回复  |  直到 16 年前
        1
  •  3
  •   Matt Ruwe    16 年前

    已使用Reflector打开System.Workflow.Runtime程序集,并找到sqlWorkflowPersistenceService的以下参数名:

    连接串
    所有权时间(以秒计)
    卸载空闲
    加载时间间隔秒
    使能

    因此,我设置了持久性配置行,如下所示,一切正常:

    <add type="System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService,  
    System.Workflow.Runtime, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" UnloadOnIdle="true" OwnershipTimeoutSeconds="10" LoadIntervalSeconds="30" />
    
    推荐文章