Post

How to debug Dataverse plugins end to end with PRT

Diesen Beitrag auf Deutsch lesen

Use the Plugin Registration Tool, correct PDB files and profiler settings to debug Dataverse plugins and plugin packages in a real environment.

TL;DR

Dataverse plugin debugging requires the latest Plugin Registration Tool, a Debug build with a usable PDB file, LegacyPluginProfiler set to false, enabled Plugin Trace Log, and a profiling replay attached from Visual Studio or VS Code.

Original by Jan Hajek, on Honza's Blarg. Read the original

This is our own summary, not a republication or full translation.

Why it matters

  • Makers: Build the plugin in Debug configuration and verify that the correct PDB file is produced, because missing symbols prevent source debugging.
  • Admins/IT: Ensure Plugin Trace Log is enabled and configure PRT with LegacyPluginProfiler set to false, because the legacy profiler can fail with plugin packages.
  • Makers: Start profiling, execute the plugin, select the recorded assembly, and attach Visual Studio or a CLR debugger to replay the execution.

Frequently asked questions

How do I configure PRT to debug Dataverse plugin packages?

Set LegacyPluginProfiler to false in PRT's appsettings.json before launching the Plugin Registration Tool. This is required for plugin package debugging.

Why does Dataverse plugin debugging require a PDB file?

A correct PDB file provides the debugging information needed to debug the plugin code. Without it, source-level debugging cannot work.

How do I replay a profiled Dataverse plugin execution in Visual Studio?

Start profiling, execute the plugin, select its execution and assembly from the history, then attach Visual Studio to the process and replay it.

This post is licensed under CC BY 4.0 by the author.