How to Debug a Dynamics 365 Plugin: Trace Logs, the Profiler and the Usual Suspects
A plugin that throws a clear error is easy. The ones that cost you an afternoon are the quiet ones: the step that never fires, the update that silently does nothing, the async job that fails at two in the morning and leaves no trace anyone thinks to look for. This is the order I work through when a Dynamics 365 plugin misbehaves, from the cheapest check to the most involved. It follows on from the plugin development guide and from the older post on enabling tracing on-premises , and it assumes you are working against a sandboxed plugin in Dynamics 365 online, where you cannot attach a debugger to the server. Step 1: establish whether the plugin is running at all Before you write a single line of diagnostic code, answer one question: is your code even being invoked? A surprising share of “my plugin does not work” turns out to be “my plugin never ran.” Open the step in the Plugin Registration Tool and check five things. Message. Create and Update are not the on...