Tuesday, June 10, 2014

SharePoint 2013 workflow debug

There are many posts on the web regarding SharePoint 2013 workflow debugging. Almost all of them recommend using TestServiceHost.exe; first enabling inbound rule for this service, then starting it and attaching to it from Visual Studio (or starting debug with F5). I tried this approach but with no success, breakpoint simply wasn't hit.

So, I tried different approach, and it is also much easier procedure:

NOTE: I have Workflow manger installed on the same machine as SharePoint 2013.
1. Open Visual Studio and open project with your workflow and deploy your workflow (if it isn't already deployed).

2. Check that debug option is enabled;
Right mouse click on your project and click on "Properties". Click on tab "SharePoint" and check if option "Enable Workflow debugging" is selected.

If it isn't, select it and redeploy solution.

3. Set breakpoint in your workflow;
Right mouse click on activity and click on "Breakpoint --> "Insert breakpoint".

4. In Visual Studio click on "Debug" --> "Attach to process"

Select "Microsoft.Workflow.ServiceHost.exe"

Click on "Select" button on the same screen

On the new screen select option "Debug these code types" and select "Workflow"

Click "OK" button and then "Attach" button.

5. Now you are all set, and if you run your workflow, your breakpoint should be hit like shown on the last image.

No comments:

Post a Comment