Creating a sample plugin for example “on updating of account name email address should update”
While updating account record, if you get any error dialog from the plugin we need to check where we have issue in the code but it will be very difficult if the logic in the plugin is complex. So in quick way to find the issue we can debug the plugin in few steps.
To debug the plugin follow the below steps:
Go to Plugin Registration tool kit click on the install Profiler as shown below screenshot.
Then select the step and click on start profiling as shown below
Click on ok.
Execute your plugin event here on update the account. You will get this error dialog as shown in below screenshot.
Download the error Log file.
Go to Visual Studio –> Add Debugger in the code then à click on debug –> click on Attach to Process.
In the Attach to Process dialog select the Plugin Registration Tool and click on Attach.
Finally navigate to plugin registration tool, click on Debug and select location of the error file in the profiler and your plugin assembly dll in the Assembly Location.
Then click on the Start Execution.
As soon as we will click on Start Execution button, it should take us to breakpoint in visual studio like following:
Hope this blog helpful to debug the Plugin in Dynamics 365