How to Retrieve Plugin Code from a Plugin Assembly in Dynamics 365
Problem Statement :
A plugin was updated and deployed by directly replacing the DLL file without checking the corresponding source code into the version control system.
Recently, the plugin logic started failing in the environment. During debugging, it was identified that the issue originated from this plugin. However, upon reviewing the existing codebase in source control, the relevant plugin source code could not be found, making it difficult to trace, analyze, or fix the issue.
Don’t panic!!! 😎
Please follow the steps below to retrieve the code, after which you can proceed with working on the issue:
- Download the dotPeek application (.NET Decompiler and Assembly ) using any browser
Just add it and then export the solution.
The solution will be exported in a .zip file format.
Another way is using XRM ToolBox tool 🙂
- Download, install and connect with your organization
- Search for Assembly recovery tool and open it
It will be downloaded to your PC with a .dll extension.
You may use either of the above methods to export the assembly 🙂
Navigate back to the dotPeek application and proceed with the steps outlined below:
Select the “File” option and select “Open”
In the first example, the .dll file exported via XRM Toolbox was selected:
In the following example, the .zip file exported from the Power Apps solution was selected:
IMPORTANT : The code obtained using the dotPeek application will not exactly match the original source code, as it is decompiled. During decompilation, the system optimizes the code, removes certain unnecessary elements, and strips out all comments.
Therefore, carefully review and validate the code before pushing it to the repository.
Snapshot of the original code:
No comments:
Post a Comment