How to get plug-in DLL from online CRM?
For suppose in online CRM getting a issue from one plug-in
and you need to solve that issue. If have source code we can easily solve it
but if you don’t have source code then what you will do?
If it is in on premise CRM easily we can get the DLL content
from PluginAssemblyBase table and convert that content to bytes and save it to
your local disk and using .NET Reflector you can decompile the DLL.
we can get the dll using solution like create new solution , add plug-in to it and can export the solution. From that solution we can get the dll , suppose if you don't have the permission of create solution and export solution then how will do? At this situation we can get the dll using c# code as :
Using c# code we can get the DLL content and save that file
to local disk from there you can decompile the DLL using .NET Reflector.
C# Code to get DLL content from Online CRM is:
ServerConnection conn = new ServerConnection();
OrganizationServiceProxy service = ServerConnection.GetOrganizationProxy(conn.GetServerConfiguration());
QueryExpression query = new QueryExpression();
query.EntityName = "pluginassembly";
query.ColumnSet = new ColumnSet(true);
query.Criteria.AddCondition (new ConditionExpression ("pluginassemblyid", ConditionOperator.Equal, new Guid ("a02b8de6-9551-479f-94c1-aa552ea30e87")));
EntityCollection coll = service.RetrieveMultiple (query);
You can get the plug-in id from the registration tool
After retrieving the plug-in save the content to local
folder:
byte[] data = Convert.FromBase64String (coll.Entities[0]["content"].ToString());
FileStream fs = new FileStream("C:\\Kranthi\\" + coll.Entities[0]["name"].ToString()+".dll", FileMode.Create, FileAccess.ReadWrite);
BinaryWriter bw = new BinaryWriter(fs);
bw.Write(data);
bw.Close();
by using above code you can save the DLL into your local
folder.
No comments:
Post a Comment