CRM 2011 – Debugging plugins using the Plugin Registration tool

I was having a bit of a nightmare debugging my plugins.  The plugin was working in my test case but when I deployed it and tried to run it from CRM, I was getting errors.

I had tried to setup remote debugging which I have done before but this time I was having problems because of some kind of firewall related problems and when I dropped my firewall the remote debugger could talk to my computer but the debugger wasn’t catching.

I then tried to get the profile/debugger working in the plugin registration tool but I kept getting stuck when it asked for a profile location, WHAT THE HELL IS THIS PROFILE.

I tried to google instructions for the profile/debugger but I couldn’t find anything but then out of the blue one of the blogs I follow wrote an article about it and saved the day.

if you want to use the plugin registration tool debug then follow these instructions

so basically you have to install and turn on profiling, then go into CRM, trigger the plugin.  This will then download your profile file.  Then in the Plugin Registration tool debug the plugin, choose your dll and newly downloaded profile text document, set the debug on your visual studio and attach the process to the plugin registration tool.  Now in the Plugin Registration Debug page, click Start Plugin Execution.

Basically the profile you downloaded is probably serialized variables and values which is now loaded into visual studio, allowing you walk through the code with the values you entered into CRM.

The tool is great and you can do it all from your PC.

Now onto the problems I was having.  I had set up a plugin to run on the post operation of an entity update.

What seemed to be happening was the main values of the entity were being copied but no related entity information was being created.  My code was using one of the related entities in a query.

To get round the problem I used the guid of the entity and retrieved the related entity information and then I could walk through the rest of my code.


4 thoughts on “CRM 2011 – Debugging plugins using the Plugin Registration tool

  1. punditor November 1, 2013 / 9:43 pm

    hi, nice post on CRM Plugins remote debugging. Couldn’t find an easy to follow example for a while, but yours is very straight forward.



Leave a Reply

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

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

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.