2
我想,因爲我使用的網絡服務器託管.xamlx服務如何添加自定義PersistenceIOParticipant使用的web.config
host.WorkflowExtensions.Add(new HiringRequestInfoPersistenceParticipant());
複製下面使用web.config中的功能的web服務器託管.xamlx服務
我已經嘗試了以下,我已經能夠收集搜索,但沒有滿意。
<extensions>
<behaviorExtensions>
<add name="sqlTracking"
type="ApprovalService.Persistence.HiringRequestInfoPersistenceParticipant, ApprovalService.Persistence" />
</behaviorExtensions>
</extensions>
任何幫助將深表感謝。
這裏是我的web.config更新
<system.serviceModel>
<extensions>
<behaviorExtensions>
<add name="sqlTracking"
type="ApprovalService.HiringInfoElement, ApprovalService"/>
</behaviorExtensions>
</extensions>
<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"/>
<sqlTracking/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
這一切都編譯並運行,但自定義持久化對象從來沒有得到的調用。
感謝莫里斯,你能進一步解釋一下呢?我的HiringRequestInfoPersistenceParticipant繼承自PersistenceIOParticipant。我會簡單地用我的HiringRequestInfoPersistenceParticipant替換你的stringWriter嗎?我想WF會發現它是一個PersistenceParticipant並且恰當地使用它? – Steven
是的,這是正確的。 – Maurice
我已經添加了一個更新的配置文件,但是我的持久對象永遠不會被調用。我可以看到工作流本身得到的持久化到InstancesTable中的實例存儲,但我的自定義持久性代碼似乎永遠不會被調用。我感謝你的繼續幫助。 – Steven