Good afternoon can somebody help me with the following issue, I'm facing a very strange problem in production Enviroment that does not happen in QA or Development enviroments:
CRM Internal Error in Application.Unexpected exception from plug-in (Execute): AssamblyName.PluginName: System.BadImageFormatException: Bad IL range.
I have already researched about possible causes:
https://support.microsoft.com/en-us/help/967163/badimageformatexception-occurs-when-instantiating-types-defined-in-a-r
Cause
32-bit processes can only load and execute 32-bit modules in process. Likewise, 64-bit processes can only load and execute 64-bit modules in process.
If your application is compiled to target a specific platform (x86 or x64), but attempts to load and execute an assembly that targets a different platform, the BadImageFormatException will occur. This behavior will also occur if your application is compiled targeting the "AnyCPU" platform, and then is run an operating system whose platform differs than the assembly whose type you are trying to instantiate. For example, if the main application is compiled to "AnyCPU", and references an assembly that targets x86, then if you run the application on an x64 operating system, the BadImageFormatException will occur.
This behavior is by design.
But my plugin is already compiled ass AnyCPU and in .Net Framework 4.5.2
Microsoft Dynamics 365 Version 1612 (8.2.2.160)
Thanks in regards.
*This post is locked for comments