Thursday, February 11, 2010

Debugging WSS 3.0/SharePoint 2007 workflows in a 64-bit environment

You may have found that you are unable to attach to a process to debug a workflow project in a 64-bit environment, getting an access denied error. I hated having to switch environments from a x64 to x32 just to debug.

Well I stumbled upon a way to do it in x64, and it is pretty easy. I use VS2008 in Windows Server 2008 x64.

I don't know why, but the basic point is that you can't attach to a process with the Workflow code type in x64. If you have run a workflow in the current running process, it will be selected in the code type to debug, giving the access denied error, thus debugging won't work. But, if you attach to the w3wp process BEFORE it does that (after restarting IIS and before running any workflows), once you run the workflow it will debug.

So basically,
  1. Restart IIS
  2. Warm up a page, but DON'T run a workflow
  3. Attach to the process(es)
  4. Run the workflow, and your breakpoints should be hit.

2 comments:

  1. Helped me out after losing a lot of precious time. Thanks !

    ReplyDelete
  2. Excellent!! Thanks for the solution :-)

    ReplyDelete