Debugging a Plug-in

Plugin is a .NET assembly that can be used to intercept events generated from the CRM system to perform a variety of actions. Some common plug-ins will perform a complicated update routine on CRM entities and\or attributes when it might be impractical to use Javascript or Workflow.

Not like in most of the other developments, in Plugins developers have to debug the CRM plugin code at the time of running the application. Developers writing the plugin code inside the plugin and some times the logic can be write in a seperate assembly and from the plugin code it can be invoked. When writing the whole logic inside the plugin is little complex to test the plugin logic by debugging the plugin as it executes from the application itself in a given event such as create an entity, update or delete.

There are two ways of debugging a CRM plugin as follows,
[1] Attaching the debugger to the w3p.exe process
[2] Forcing the add-in to call the debugger

A plugin has written targeting Account entities as follows and a step has registered to be fired on Account entity’s Create step.
Continue reading “Debugging a Plug-in”