Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 general forum

Error: "Plug-in assembly does not contain the required types or assembly content cannot be updated" while registering Plugin Dynamically in Assembly

(0) ShareShare
ReportReport
Posted on by 25

Hi everybody,

I'am developing a feature in D365 that allows the creation of plugins dynamically in an Assembly selected by administrator.

However i'am getting the following error : "Plug-in assembly does not contain the required types or assembly content cannot be updated".

For this example iam using the assembly called: "Dynamics365.Plugins".

This is my code:

var pluginCreate = new PluginType()
{
PluginAssemblyId = new EntityReference(PluginAssembly.EntityLogicalName,new Guid(assemblyId)),
TypeName = "Dynamics365.Plugins.Testing",
FriendlyName = "(APPROVAL) " + approvalTarget.noesis_ContextEntity + " " + namePluginStep,
Name = "(APPROVAL)." + approvalTarget.noesis_ContextEntity + "." + namePluginStep,
Description = "Plugin Registered Dynamically",
};

TracingService.Trace($"PluginAssemblyId : {pluginCreate.PluginAssemblyId}");
TracingService.Trace($"TypeName : {pluginCreate.TypeName}");
TracingService.Trace($"FriendlyName : {pluginCreate.FriendlyName}");
TracingService.Trace($"Name : {pluginCreate.Name}");
TracingService.Trace($"Description : {pluginCreate.Description}");

string pluginId;

try
{
pluginId = BusinessContext.Create(pluginCreate.ToEntity<Entity>()).ToString();
pluginStep.noesis_PluginId = pluginId;
}
catch (Exception e)
{
TracingService.Trace($"Error Message : {e.Message}");
throw new InvalidPluginExecutionException($"Could not create Plugin.\n\n");
}

This is my trace:

PluginStep ID: 5c08b5dd-f491-e911-a964-000d3a441cb0
Name: PreCreate
Approval Target ID : ede6525d-7690-e911-a964-000d3a441cb0
New Step Mode : Microsoft.Xrm.Sdk.OptionSetValue
New Step Rank : 1
New Step Stage : Microsoft.Xrm.Sdk.OptionSetValue
New Step DeleteAsync : False
New Step Name : PreCreate
New Step Filtering Attributes :
Assembly Id: e7cfcfb6-dad6-4eaf-9a51-c15b8822f1c5
PluginAssemblyId : Microsoft.Xrm.Sdk.EntityReference
TypeName : Dynamics365.Plugins.Testing
FriendlyName : (APPROVAL) opportunity PreCreate
Name : (APPROVAL).opportunity.PreCreate
Description : Plugin Registered Dynamically
Error Message : Plug-in assembly does not contain the required types or assembly content cannot be updated.

Hope you can help.

Thanks

Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Dynamics 365 general forum

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans