Search code examples
wcfdebuggingworkflow-foundationresumestep-into

WCF/WF - Why can't I publish updated code and resume / debug a suspended workflow on it


I have a WCF workflow using AppFabric / Persistence and .net 4.0 that I know is going to have a few bugs in the code activities due to the fact that its talking to an external soap service that sometimes throws SoapExceptions as return values when an operation cannot be completed. Its unavoidable, and there are an extreme amount of exceptions to handle them all from the get-go.

While developing, when these errors occur, my workflow suspends, and I can track down the error fairly easily, and code a handler for the newly found soap exception. The problem is, after I make changes to the codeactivity and publish the new dll, a "resume" of the suspended workflow does not utilize these changes, nor can I break in the code upon resume.

The workflows try their 5 times to run, then rethrow the same error, even if it was something like throw new exception ("TEST EXCEPTION") and then i removed it from code.

I am NOT changing the definition of the workflow, just making small changes to codeactivities.

I swear I could do this in VS2010 but its been a long time since i switched to vs2012. FYI I can debug new workflows that have not been suspended. I can step through the code. Just cannot debug ones upon resume.


Solution

  • I am able to resume and debug by upgrading the schema using C:\Windows\Microsoft.NET\Framework\v4.0.30319\SQL\en\SqlWorkflowInstanceStoreSchemaUpgrade.sql and changing to .net 4.5

    It may not be the most elegant solution, but it works.

    I'd also like to state that I personally hate solutions like this, especially after searching for them. If you came here and cannot deploy 4.5, I apologize.