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
Please refer to the GIT HUB Article :
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.
André Arnaud de Cal...
292,160
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156