Here are the steps as in how you can use Profiler for debugging plug ins:
- Connect to CRM using plugin registration tool.
- Click on Install Profiler
- When the Plug-in Profiler is installed successfully, make sure it exists under the assemblies.
- Select a plug-in step and click Start Profile to enable profiling.
- Click the Start Profiling button, and the Profiler Settings dialog appears. These profiling settings are good for most scenarios. Click OK.
- Perform the steps in CRM so that the plug-in step you are profiling gets executed. The Business Process Error dialog box appears.
- Then in Visual Studio attach to process “plugin registeration.exe”. Add the breakpoint from where you would like to debug.
- In Profile location provide the path of the error log of the plugin.
- In Assembly location provide the dll of the plugin from which you got error.
- Then select the Plugin class from Plug-in. This drop down will contains all classes present in the dll.
- To start debugging just click on Start Plug-in Execution.
You can optionally click the down arrow to download the profile execution log from the server. You will have files there if you previously selected Persist to Entity in the profile settings when you started the Plug-in Profiler.
- Click Start Execution, and debugging starts in Visual Studio