Trying to get to the bottom of a Windows Workflow 4.5 issue
Asked Answered
B

0

6

The error I am getting is

"The WorkflowApplication has been aborted because a Load or LoadRunnableInstance operation threw an exception. Create a new WorkflowApplication object to try loading another workflow instance."

I am using "workflowapplication" to run the workflow. The workflow instance I'm trying to load (there are a few of them) were created sometime ago and were persisted into the database.

Is there a way to find the exception that was actually thrown during Load or LoadRunnableInstance operation? I caught this error in the "aborted" event on the workflowapplication object, but it does not tell me the error that was thrown during load.

New addition

I stuck the following code in my web.config to get more details about the above exception:

<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>

This pointed me to the exception

System.Activities.DurableInstancing Warning: 131075 : http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ThrowingException.aspxThrowing an exception. Source: System.Activities.DurableInstancing 4.0.0.0. Exception details: System.Runtime.DurableInstancing.InstancePersistenceCommandException: The execution of the InstancePersistenceCommand named {urn:schemas-microsoft-com:System.Activities.Persistence/command}LoadWorkflow was interrupted by an error. ---> System.Runtime.Serialization.SerializationException: The deserializer cannot load the type to deserialize because type 'System.Data.Entity.DynamicProxies.VacancyQuestionFormA_0A0432BFEF4023483E1B33251D8373454EAC6EDF2B2C6F312A4F606F45AF30E8' could not be found in assembly 'EntityFrameworkDynamicProxies-ConnectCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Check that the type being serialized has the same contract as the type being deserialized and the same assembly is used.

So now my issues is how to deal with Dynamic proxies that are being serialized. From what I've read, these are on demand so won't be guaranteed to be in the Dlls especially as we have multiple developers.

We already have clients that will have instances of the workflow with serialized Proxy classes.

My question now becomes: Is there a built in way for Windows Workflow to deal with Serialized Proxy classes more eloquently?

Bespangle answered 22/9, 2016 at 2:20 Comment(5)
Has the workflowdefinition changed?Zoroastrian
I am dealing with the exact same issue at the moment. You can get the exception details by wrapping the WorkflowApplication.Load() or WorkflowApplication.LoadRunnableInstance() into a try catch block, and inspect the exception. In my case, I get the same exception as discussed here: social.msdn.microsoft.com/Forums/en-US/… - unfortunately, no conclusion is made in that thread. However, I will continue looking into this next week and will hopefully get back with a conclusion.Tinny
@LasseChristiansen I've updated my question with some things I tried. Basically I had tried the method you suggested, but got the same error I initially did.Bespangle
@Zoroastrian The definition has not changedBespangle
@FallenFate In my case, WorkflowApplication.Load() failed because I tried to load an instance state that had already completed, i.e., there were no more bookmarks to resume.Tinny

© 2022 - 2024 — McMap. All rights reserved.