locked
Problem when attaching to a process when attempting to Debug Code based Workflow 4.0 RRS feed

  • Question

  • Using VS2010
    Windows XP SP3

    Created a console based app. and executing the following lines:

    application = new WorkflowApplication(CreateWF());
    application.Run();

    Inside CreateWF() the code instantiating the FlowChart activity and couple FlowStep acitivities. 

    I'm able to set a breakpoint inside the CreateWF() and its being hit when all the activities are instantiated, but what I'm not able to do is to step through the code when FlowChart is actually running, in other words when individual FlowSteps are executing not able to set a breakpoint or follow the transitions between the FlowSteps.

    Following the online documentation attempted to attach to a process:

    Selected Debug dropdown, Attach to Process
    It displays the list of priocesses, but the workflow application.vscode.exe is greyed out and Attach button is greyed out. Selected Attach to: Workflow Code.

    Please advise on the correct steps to debug the workflow run-time.

    Attempted to debug when executing workflow synchronously

    WorkflowInvoker

     

     

    .Invoke(CreateWF());

    Still not able to attach to a process.

    Please advise.

    • Moved by Andrew_Zhu Tuesday, March 2, 2010 8:06 AM (From:Windows Workflow Foundation)
    Wednesday, February 24, 2010 3:55 PM

Answers

  • Debugging code based workflow is just like debugging normal C# code debugging. Workflow debugger works with WF designer only.

    For code only workflow, you will need to set breakpoint in the activity implementation code, such as the Execute method.

    As for debugger attach, the <application>.vshost.exe process can't be attached. You need to choose <application>.exe and attach the debugger to it.

    Best Regards,

    Leo

    This posting is provided "AS IS" and confers no rights or warranties.

    • Proposed as answer by Leo.Chen Monday, March 8, 2010 7:41 AM
    • Marked as answer by Scott Mason - MSFT Monday, March 29, 2010 9:52 PM
    Monday, March 8, 2010 6:59 AM