tirsdag den 20. november 2012

WCF self-hosted Windows Workflow flowchart debugging

I'm looking into Microsoft Windows Workflow solutions - a really powerful tool, once you get the hang of it (it's a steep learning curve).

Testing a workflow is the easiest if you simply host the workflow within Visual Studio's own development web server. But I've found a debugging issue if you use a flowchart workflow as opposed to a sequential workflow.

In my case I was trying to step into a custom activity (a codeActivity), but no matter how I tried it, my breakpoints would not be hit. If I ran a sequential workflow, no problem, the breakpoints got hit.

The 'solution' was to simply start two instances of Visual Studio, load the solution into both and for the first one set the workflow project as the start-up project (and fire it up), and for the second one set the other project that's hitting the service (a console-application, in my case) and fire that one up. Having its own seperate managed instance ensured the workflow projects breakpoints were hit.

Another solution would be to add a 'Debugger.Break();'-statement, which would then, when hit, offer you a choice of debugging the solution. But it's far easier to just seperate the projects with two Visual Studio sessions.

HTH others.

Ingen kommentarer:

Send en kommentar