How to get the exception that caused the Persist action?

I have a standard WCF service workflow with multiple Persist actions (all created using drag and drop user interface). Most persistent actions succeed, but one of them fails.

Detecting a failed Persist action in the Try / Catch block does not help - it simply steps over the capture and terminates the workflow.

How to find the specific reason why the save failed? Any exception is logged anywhere?

I am developing Windows XP.

+4
source share
3 answers

To get specific information about the main error, run the workflow in debug mode (or join w3wp.exe). In Visual Studio, make sure the "Only my code" option is NOT included in "Debug"> "Options and Options" and make sure that you have enabled "Debug"> "Exceptions"> "Exceptions for the common language." Then the IDE will give you an error while passing.

The thing is, you cannot do this on the production server, so you don’t know how to get detailed information about errors during the production process if only a high-level message is indicated in the tracking event.

+3
source

I register an exception in a file that adds a listener to the System.Activities.DurableInstancing namespace, you can 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 is explained on my blog http://pablocastilla.wordpress.com/2012/05/18/how-to-analyze-a-workflow-foundation-4-0-persistence-problem/

+7
source

Adding an ETWTracingParticipant member should help you see the error in the Windows event log. Something that is often a problem is that some of the states of your workflow are not serializable.

+2
source

Source: https://habr.com/ru/post/1341271/


All Articles