Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the exception that caused a Persist action to fail?

I have a standard WCF service workflow with several Persist actions (all created via UI drag and drop). Most of the persist actions succeed, but one fails.

Wrapping the failing Persist action in a Try/Catch block does not help - it just steps over the catch and terminates the workflow.

How do I find the specific reason why the persist failed? Is any exception logged anywhere?

I'm developing on Windows XP.

like image 839
jimasp Avatar asked Dec 16 '22 17:12

jimasp


1 Answers

I log the exception in a file adding a listener to the System.Activities.DurableInstancing namespace, you will be able to see the exception there:

<system.diagnostics>
    <sources>
      <source name="System.Activities.DurableInstancing" switchValue="Verbose">
        <listeners>
          <add name="textListener" />
          <remove name="Default" />
        </listeners>
      </source>
    </sources>
    <sharedListeners>
      <add name="textListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\Log\persistenceproblem.txt" traceOutputOptions="ProcessId, DateTime" />
    </sharedListeners>
    <trace autoflush="true" indentsize="4">
      <listeners>
        <add name="textListener" />
      </listeners>
    </trace>
  </system.diagnostics> 

Here it is explained in my blog http://pablocastilla.wordpress.com/2012/05/18/how-to-analyze-a-workflow-foundation-4-0-persistence-problem/

like image 187
Pablo Castilla Avatar answered May 01 '23 09:05

Pablo Castilla