Debug Workflow from Winform App

I have exposed a workflow as a web service and have added a winform project to the same solution the workflow is in. Within the Winform app, I added a reference to the web service and call the web method provided by the interface. I cannot determine however, how to debug into the workflow.

I have seen the following directions for debugging an ASP.Net app:

1. Enable debugging for the ASP.NET application by setting debug = true in the web.config file.
2. Set the workflow library as the startup project, and set breakpoints on the workflow.
3. Enter the URL of the default Web page in the workflow project properties\Debug\ Start browser with external URL text box.
4. In VS, select Debug\Attach to process menu
5. Click "Select" next to the "Attach To" text box.
6. This opens up "Select Code Type" dialog. Select "Debug these code types" and select "Workflow". Click Ok
7. Select webdev.webserver.exe in the Attach to process dialog and click Attach
8. Open the Web page which starts the workflow

What would be the procedure for a Winform app call this web service? I could see where steps 3 and 7 might be different but haven't figured out the right combination.

Thanks!

[1286 byte] By [stombiztalker] at [2007-12-22]
# 1

The key thing is that the workflow project be the startup project. Set the URL (step 3 above) to be the url for browsing to your web service. This will get the web server started. Attach to the webserver.exe and then right click your winform app and choose Debug -- start.

Now you should be able to run your winform app and hit breakpoints in the workflow. Make sure you do step # 6 above so you are sure to get the workflow debugger involved.

Matt

MattMilner-Pluralsight at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 2

Matt,

The problem is, when you do the attach, you no longer have the option of starting the Winform app. The Winform app is in the same solution and all menu items related to starting to debug are greyed out.

Thanks!

stombiztalker at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 3
Matt, what I ended up doing was moving the winform app out to its own VS environment. Then I was able to set my debug points and debug.
stombiztalker at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 4

If you right-click a project in the solution explorer, you can choose Debug - start new instance, even if you already F5'd the solution. The main Debug menu won't do you any good after you have already started the solution.

A better option is probably to right click the solution and choose "set startup projects". Then choose to have your workflow project start and your winform application start. Make sure you configured your workflow project to browse to the URL of your web service to make sure the webserver.exe process starts.

You will still have to attach to the webserver.exe process (or wp3.exe) to debug into the workflow, but all of your applications should be running and debuggable.

Matt

MattMilner-Pluralsight at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 5

Well, for some automagical reason, after I removed the Winform app from the solution and got it to debug, I then added it back in and my menu item was now not greyed out.

time for me to get some sleep!

Thanks!

stombiztalker at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...

Software Development for Windows Vista

Site Classified