This article is a reference for those who are having difficulities setting up their environment to debug custom workflow activities:
Common Irritant 1: Unable to attach to the process in Visual Studio
Symptoms: When attempt to attach to the wp3 and Microsoft.ResourceManagement processes on the Portal server so that you can step through the code of your activity, you receive the message "Unable to attach to the process. Visual Studio has insufficient privileges to debug this process. To debug this process, Visual Studio must be run as an administrator", even though you are an administrator or are running VS as one
Try This: More likely than not, your account (even if it is an adminsitrator) does have the seDebugPrivilege token. To verify this, check the Debug Programs policy in the User Rights Assignment section under Local Policies (Start --> Administrative Tools --> Local Policies --> User Rights Assignment --> User Right Assignment: Debug programs). If you do not see your name or a group to which the account your using belongs, that is your issue.
Common Irritant 2: Break points are not getting hit - No symbol files are loaded
Symptoms: Ok, so you've compiled your code, strong named it, threw it in the GAC, created the AIA for it -- and now there is a problem. So you open the project in Visual Studio, attach to the w3wp.exe and Microsoft.ResourceManagement.dll processes, set a break point to where you feel is meaningful, and you get that damn empty circl that say "The Breakpoint will not currently be hit. No symbols have been loaded for this document."
Try This: Here is a couple of things to verify:
- Was the assembly you are attempted to debug compiled in release or debug mode? It must be compiled in debug mode in order for you to attach to the process
- How did you attach to the process? Did you select Managed Code? If not, detach and try again
- Is Visual Studio configured only debug "your code"? To check, go into Tools-->Options-->Debugging--> Enable Just My Code (Managed Only). Make sure it is unchecked.
Hope this helps.