UPDATE (30/07/2010) : I haved updated few steps based on comments from Andriy Butenko (CRM MVP)
If you got plug in or custom workflow application which is not working as expected on CRM server or giving unexpected error then following is the check list to set up for debugging Plug in/Custom workflow application.
1-Ensure that your plug-in is signed ( For Custom workflow this step is optional)
2-Rebuild the plug-in/Custom workflow
3-Restart CRM web site (i.e. run an iisreset command on server)
4. Also restart CRM Asynchronous Service on CRM server
5-copy the .pdb file and your .dll file to server\bin\assembly
6-Register the Plug-in Registration Tool V2 (http://code.msdn.com/crmplugin)
7. Refer to your dll in bin\assembly
8. Make it disk deployment (This step is also optional)
9-Register the step
10-Register the image if needed for relevant Plug-in
11- Open the relevant application in visual studio and click on Debug -> attach and then
select w3wp.exe if Synchronous plug-in or
select CRMAsyncService if asynchronous plug-in or Custom workflow.
12. You must be all set by then and just need to put breakpoint on relevant code line.
Note:- steps 9 & 10 are not needed for custom workflow application.
Hope this helps…