Skip to main content
Dynamics 365 general forum
Suggested answer

Dynamics 365 Plugin Registration

editSubscribe (0) ShareShare
ReportReport
Posted on by UG Leader

Hi All,

I have an issue with registering a custom workflow assembly file using plugin registration tool. I have created this assembly referencing an external dll ITextSharp.dll, assembly build is going as expected, I used ILMerge to get the merged dll and when I try to register the merged dll I get the below message

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'ABC.CRM.Workflows, Version=1.0.0.0, Culture=neutral, PublicKeyToken=77166a3fe764c9f6' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Microsoft.Crm.Tools.Libraries.CrmAssemblyReader.LoadAssembly(String path)
at Microsoft.Crm.Tools.Libraries.CrmAssemblyReader.RetrievePluginsFromAssembly(String path)
at Microsoft.Crm.Tools.Libraries.CrmAssemblyReader.RetrievePluginsFromAssembly(String path)
at Microsoft.Crm.Tools.Libraries.RegistrationHelper.RetrievePluginsFromAssembly(String pathToAssembly, String appPath)
at Microsoft.Crm.Tools.AssemblyRegistration.PluginRegistrationViewModel.BtnLoadAssemblyClicked()
Inner Exception: System.Security.SecurityException: Strong name validation failed. (Exception from HRESULT: 0x8013141A)

Project default framework: .NET 4.5.2

As I used ILMerge CopyLocal property of the external library is set to True and the rest is set to False

Been stuck with this for about a week now. I'd really appreciate any advise/suggestions.

Thanks,

Vinod

Attachments
  • Suggested answer
    RE: Dynamics 365 Plugin Registration

    Please refer to the GIT HUB Article :

    github.com/.../58

    Please check if you are performing the suggestion as below :

    Sorry, but that won't work. ILMerge works by taking each member of the input assemblies and reparents them so that they belong to the merged assembly. For instance, if there is a type T in an assembly A, then it's fully-qualified name is "[A]T" (using the format that you'll see if you use ildasm to open an assembly). If you use ILMerge to merge assembly A into the merged assembly M, then the type T has the fully-qualified name "[M]T". It is a totally distinct type (to .NET) from [A]T.

    Hope that is clear. Let me know if you need any more help.

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,080 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,601 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Featured topics

Product updates

Dynamics 365 release plans