Debug CRM Plug-ins and Workflows from your local Visual Studio 2010

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.

  1. 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.
  2. 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
  3. Once the Remote Debugger is installed go to Start->All Programs->Microsoft Visual Studio 2010 ->Visual Studio2010 Remote Debugger Configuration Wizard.
  4. 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
  5. 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.
  6. 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.
  7. 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.
  8. Make a change which causes the plug-in/workflow to trigger, and then the break points will be hit.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s