Have you ever stuck in a situation where the plugin working perfectly in a test environment but not the SIT/UAT/Production environment?
Remote debugging might be a tricky setup in most of the production server because of the firewall constraint or even many times developer does not have access to the following environment. In such situation how we can survive, Debugging skills will save us in this situation.
Debugging is must skill for every developer while updating or fixing any code; we need debugging skills. We actually can debug the plugin without connecting to CRM server. We need to capture that particular part and debug it just like you test environment and during debugging this you can modify your code and don’t need to update in MS CRM. These profilers will use your local code from your local computer. MS CRM 2015 and above environment have this ability.
This method will explain debugging without exception and click this for debugging with exception or with console application
Here are the steps for this…..
- First, open your plugin Registration tool
- Select your plugin
- Select your step where you want to find the issue
- Hit ‘Start Profiling’ button ….
Refer below image for same …
- It will open profiler setting, select ‘Persist to entity’ option, for first option exception is needed
- Then work in MS CRM, and trigger that plugin, it will create the plugin profiler for you in CRM, you will get that in MS CRM >> Settings >> Plugin Profiles
- Now, go back to Plugin Registration, and hit ‘Debug’ after selection of your correct step (same one which we created profiler in step 1/2)
- Now select profile
- sometimes while selecting profiler there is confution to select correct instance, in such a scenario go to ‘Plugin Profiler’ in CRM and delete all of them and recreate your scenario
- Select assembly from your local machine
- Now open Visual Studio and attach ‘PluginRegistration.exe’
- After this selection, start execution
- Now debug just like normal local project ….
- For more information please go here.
For more info please refer this link.