Senick
Senick

Reputation: 101

How to: Retrieve a Plugin from a PluginAssembly

I am trying to get a plugin from a pluginassembly object using early bindings.

List<PluginAssembly> pluginList;
pluginList = xrmContext.PluginAssemblySet
    .Where(Plugin => Plugin.SolutionId == solution.Id).ToList();
foreach (PluginAssembly tempPlugin in pluginList)
{...}

Now I want to retrieve the Plugins in the assembly but I can't seem to find a class named Plugin or a clear defined collection in the PluginAssembly object.

How do I retrieve the Plugin object?

Upvotes: 1

Views: 264

Answers (2)

Daryl
Daryl

Reputation: 18895

Plugins have to implement IPlugin. I'm not sure what information PluginAssembly gives you, but I'm guessing you should be able to use reflection to get the classes in the assembly, and then determine if they implement IPlugin or not. See this answer for help with that.

Upvotes: 0

Senick
Senick

Reputation: 101

You have to retrieve pluginTypes objects.

It just wasn't clear.

Upvotes: 1

Related Questions