PL 400 : debug and troubleshoot a plug-in (Create a plug-in)

Generally, developing a plugin requires special skills, after development, registering the appropriate stage is also a challenge, but in the Dynamics CE world, debugging and troubleshooting is highly challenging and developers always love such adventures.  Debug and troubleshooting are two different activities, debugging is the process of detecting and removing potential error commonly called bugs. Sometimes, both the words are interchangeable. Troubleshooting can be procedural identification and prevention of potential issues.



Plugin registration tool plays an important role in plugin development and it also helps in debugging. If we need to debug Microsoft Dataverse plugin or plugin in production environment, we need to use Plugin Profiler. We can install Plugin Profiler from Plugin Registration Tool.

After installation of Plugin Profiler, it will appear on the top header of the tool like below:

When set the plugin profiler on the selected step, Profiler setting window will open like below:

In this window, there are two options 

Exception: This option is useful when the plugin is synchronous. In this selection, the business process error will open which contains the log file for debugging.




Persist to Entity: This option is useful when the plugin is asynchronous. In the selection, profiled operation will store in the custom entity. 



Download log file contains the profile that the plugin profiler will use to play back execution. Open the plugin solution in visual studio and go to debug> attach process and selection plugin Registration.exe. Set a breakpoint in the plugin code.


Go back to the Plugin Registration Tool and click the Reply Plugin Execution button that is on the command bar or select the step we are profiling and click the Debug. Select ErrorDetial.txt for the profile location and select the debug version of the plugin assembly of the assembly location.


We can optionally click the down arrow to download the profile execution log from the server. we will have files there if we previously selected Persist to Entity in the profile setting when we started the plugin profiler.

Click Start Execution, and debugging starts in Visual Studio.


Comments

Popular posts from this blog

Exploring the Differences: Managed vs. Unmanaged Solutions in Dynamics CRM/Dataverse

PCF vs. Web Resources: Choosing the Right Extensibility Tool for Dataverse

Effective Strategies for Debugging Plugins in Dynamics CRM