Advertisements

Archive

Posts Tagged ‘Plug-in Profiler’

[D365 CE Online] Debug Async Plug-in using “Persist to Entity” profiler option

December 1, 2018 4 comments

As you are aware, using Plug-in Profiler option we can debug D365 online plug-ins by throwing exception and capturing the Serilaized profile. Refer my previous article

With the ‘Exception’ profiling option, you first need to trigger the event and capture the exception log. For example, if you need to debug “Post Account Create” plug-in, you first need to trigger the event (i.e., Create Account from D365 application) and capture the exception log. This ‘Exception’ option would be apt, if your plug-in registered in Sync mode.

What if your plug-in is Async? Answer is, using “Persist to Entity” profiler option.

Plugin Profile 1

Let’s see how to debug Async Plug-in step by step.

Configuring Profiler in Plugin Registration Tool:

  • Connect to your Dynamics instance using Plug-in registration tool.
  • Click on ‘Install Profiler’ button
  • Register a new plug-in assembly and add an Async step
    • In this article, I registered an Async step on Post Account Creation

Plugin Profile 9

  • Select the Plug-in step and click on ‘Start Profiling’
  • In the “Profiler Settings” screen, choose “Persist to Entity” option and click “OK”

Plugin Profile 1

Trigger Account Creation from D365 Application:

  • Connect to D365 application and create a new Account

Plugin Profile 8

  • As we opted for “Persist to Entity” profiler option, an entry will get created in “Settings -> Plug-in  Profiles” entity.
  • Go to “Settings -> Plug-in  Profiles”, open the newly created “Plug-in  Profile” record (Note: Async plug-in takes time to create a new “Plug-in Profile” record).

Plugin Profile 2

  • In the “Plug-in Profile” record, you would notice the Serialized content in “Serialized Profile” field. This is same as what you get in Exception download log if you would have opted for “Exception” profile setting.

Plugin Profile 3

Debug the Plug-in:

Once an entry got created in “Plug-in Profile” record

  • Open the Plug-in class file in Visual Studio and attach “Plug-in Registration Tool” process

Plugin Profile 5

  • Add a break point in your Plug-in class file to debug.
  • Open the “Plugin Registration Tool”
  • Select the Plug-in step and click on “Debug/REPLAY PLUG-IN EXECUTION” button
  • In the “Replay Plug-in Execution” screen, set
    • Profile = Click on ‘Down Arrow’ button to pick your “Plug-in Profile” record from D365 (Refer screen)
    • Assembly Location = Plug-in dll
    • Plugin = Class Name

Plugin Profile 10

  • Click on “Start Execution”

Plugin Profile 11

  • You should see a break point hit in Visual Studio.

Plugin Profile 7

  • Press F10 to proceed with debugging.

🙂

 

 

Advertisements

Debug Plug-ins using “Plug-in Profiler” – CRM 2011

March 22, 2013 3 comments

In CRM, we can debug the plug-ins deployed in “on premise” by following the steps in this article. But it’s always difficult to debug Plug-ins deployed in CRM online.

Now we can debug Plug-in code registered in both online/on premise also using “Plug-in Profiler”.

In CRM 2011, with the SDK 5.0.5 and later releases we got a “Plug-in Profiler” add-in along with Plug-in registration tool.

If you open the Plugin registration tool comes with latest SDK, it would look as below with profiler options.

Profiler

What all I need to debug, using “Plug-in Profiler”

  •  To debug using “Plug-in Profiler” all you need is
    • Plugin assembly .dll
    • Visual studio
    • Plugin registration tool from latest SDK

How do I use “Plug-in Profiler”

Few more points

  • “Plug-in Profiler” also provides offline debugging option using “Replaying plug-in execution”, it does not require a connection to a CRM server and organization.
  • Support for registering and executing custom workflow activities in the sandbox is new in CRM 2011 UR 12 and the CRM December 2012 Service Update

🙂