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 例外を取得するのに無効であることがわかっている値に設定しましたが、それでも何もしません。そのため、黙って失敗することで本当に良い仕事をしているか、永続性がまったく発火していないかのどちらかです。私はおそらく単純なものを見逃しています - 何かアイデアはありますか?