When working on CRM 2011 plugins we might have felt like it could have been easy if we could debug the plugins using Visual Studio. This thought will be more when we have to register the plugin in a different server which might be remote or may be don't have a visual studio version installed.
We have a solution for this kind of small problems. Follow the steps below and we can debug our plugins using visual studio.
- For registering the plugins we will be using plugin registration tool from CRM SDK. If you are not aware of how to register the same please check this link.
- Connect to your server and then the organization.
- Register our plugin to be debugged. Make sure a copy of the debug compiled plug in assembly on the computer where we are running the tool.
- In the tool's main window, select Install Profiler.
- Select the plugin step to be debugged and click on the Profile button to enable profiling.
- Perform the operation in CRM that causes the plugin to execute.
- While executing the plugin will throw an exception and the Business Process Error dialog will be displayed.
- Download the log file and save this file.
- Click Stop Profiling.
- In the plugin registration tool click on the Debug button.
- In the dialog opened we have to refer two files, one is the location of error file which was downloaded and saved, second is the location of the plugin assembly.
- If the server where the tool is running has VS then launch the same and attach the plug in registration tool process for debugging.
- Set a break point in the code.
- Click Start Plug in Execution in the debug existing plugin dialog box.
- Now you can see the debugger stops in the break point and all is yours.
If the server don't have take the VS instance in the server copy the error details file downloaded in step 8 to the development environment and continue the same process in development environment.
Hope this would help you. Happy debugging !!! :)
For Microsoft documentation of the same please refer here.
No comments:
Post a Comment