Get the Plugin DLL from Database or Managed Solution in CRM 2011/2013/2015

Hi,

There might be many situations where we would want to get the Plugin.dll from Database or Managed Solution in CRM 2011/2013/2015.

Here is the way for it.

QueryExpression objQueryExpression = new QueryExpression(“pluginassembly”);

objQueryExpression.ColumnSet = new ColumnSet(true);
objQueryExpression.Criteria.AddCondition(new ConditionExpression(“name”, ConditionOperator.Equal, “CRM.Test.PluginsAndWorkflows”));
EntityCollection entCol = objSerivce.RetrieveMultiple(objQueryExpression);
byte[] assembly = Convert.FromBase64String(entCol.Entities[0][“content”].ToString());
File.WriteAllBytes(entCol.Entities[0][“name”].ToString() + “.dll”, assembly);


Hope this helps.

Gopinath

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s