This topic explains the steps how to set up remote debugging so that we can debug plugins and workflows deployed in Dynamics CRM server from your local visual studio.
- Copy the plugin/workflow assembly dlls and .pdb files to the CRM server directory <crm-root>\server\bin\assembly (usually location is C:\Program Files \Microsoft CRM\server\bin\assembly) Note: If your assembly depends on other dlls( if they are not registered on the GAC then copy those dependent dlls to the same folder). If your assembly has already been deployed to the directory and need to update it, you may need to restart IIS.
- Download the Microsoft Visual Studio 2010 Remote Debugger from the link and install in your CRM Server. http://www.microsoft.com/en-us/download/details.aspx?id=475
- Once the Remote Debugger is installed go to Start->All Programs->Microsoft Visual Studio 2010 ->Visual Studio2010 Remote Debugger Configuration Wizard.
- On the Remote Debugger Configuration Wizard Click Next-> Do not check the Run the “Visual Studio 2010 Remote Debugger” service and click Next-> Check the check box “Allow only computers on the local network (subnet) to connect to the remote debugger, Click –>Finish
- Go to Start->All Programs->Microsoft Visual Studio 2010 ->Visual Studio2010 Remote Debugger(x64).
Go to Tools -> Options
Copy the server name and select the Windows Authentication and click OK.
- Attach the Visual Studio to CRM server remote worker process w3wp.exe for plugins and CrmAsyncService.exe for workflows and asynchronous plug-ins. Select the transport as Default and give the same server name which was on the remote debugger in the Qualifier.
- Attach w3wp.exe for synchronous plug-ins and CrmAsyncService.exe for workflows and asynchronous plug-ins to debug the plug-ins and workflows deployed in the CRM server. Note: Visual Studio Remote Debugging Monitor should be running on your CRM server to see the processes which are running on the remote server.
- Make a change which causes the plug-in/workflow to trigger, and then the break points will be hit.