After we deploy and activate the workflow function, we can debug the workflow by opening the workflow project and attaching the process to w3wp.
Tip: To make debugging easier, we recommend that you develop workflow templates on servers running Microsoft Windows SharePoint Services 3.0.
AttachWindows SharePoint ServicesProcess to debug the Workflow
1. Install the workflow.
If you have installed the workflow and modified the manifest. xml file of the workflow, useStsadmUninstall and reinstall the workflow.
2. register the workflow assembly to the Global Assembly Cache (GAC ).
3. Restart IIS to make the modification take effect. The method is to execute it on the console.Iisreset.
4. AttachW3wpProcess:
A. OpenDebuggingMenu, selectAttach to process..
ClickAttachRight sideSelect, InDebug the following code types:SelectWorkflowAnd then clickOKToAttach to SettingsSetWorkflowCode.
B. SelectW3wpProcess clickAdditional.
Tip: IfW3wpThe process is not running. Open any Windows SharePoint Services page to activate the process.
Add a breakpoint to the workflow code.
Activate your workflow on the Windows SharePoint Services website.
When your assembly is loaded, the breakpoint will be activated, and the debugger will pause the code at the breakpoint.
From: http://www.cnblogs.com/xiaoshatian/archive/2006/12/19/597141.html