5 Quick Steps to debug your CRM Online Plugin

In this article we going to provide you quick 5 steps that you can use to debug your CRM online plugin. Let say we are working with CRM online plugin and getting some error in our plugin, now we want to troubleshoot our plug-in by debugging it.
Before jumping into steps, here is what we are assuming:

  • You are connected to your CRM Online organization.
  • You have experience in plugin development.
  • You have downloaded latest CRM SDK and connected to plugin registration tool (you can find this tool under SDK\Tools\ location).
  • You have already registered plugin and getting error in your plugin which you want to debug.
  • Your plugin code is open in visual studio.

Now let’s use following steps to debug our plugin:

one Install Profiler to your CRM organization using Install Profiler button under plugin registration tool.
profiler
Make sure you are getting installation completion prompt.
two Select your plugin step and click on Start Profiling button, you don’t need to do any changes on profiler setting dialog so simply click on Ok.
startprofilingthree Execute your plugin event, for example we have plugin on account create so when will try to create account we will get business process error like following. Download the error file and store it under SDK\Tools\PluginRegistration location. Also copy your plugin dll and pdb file to same location.
pluginerror
four Go to visual studio and attach to PluginRegistration.exe process using Attach to Process option under Debug menu.
attachprocessfive Finally navigate to plugin registration tool, click on Debug and select location of the error file and your plugin assembly.
debugAs soon as we will click on Start Execution button, it should take us to breakpoint in visual studio like following:
pluginsource

One thought on “5 Quick Steps to debug your CRM Online Plugin

  1. Nikica

    HI all,
    Please check my Nuget/Github project and package:
    https://www.nuget.org/packages/DynamicsCrm.AssemblyDebugger/
    https://github.com/Nikicac/DynamicsCrm.AssemblyDebugger
    It helps you to debug your Plugin/CodeActivity directly from start of execute method (and also constoructor of your classes). No need to do deploy, profile, attach to process, replay execution….
    Check samples in TestApp (program.cs) project. After that just put breakpoint, click F5 and debug as any desktop application.
    Published version is tested with .net framework 4.5.2, 4.61 and CRM SDK 8.0 and 9.0.

    Reply

Leave a Reply to Nikica Cancel reply

Your email address will not be published. Required fields are marked *