[英]Could not load file or assembly 'Microsoft.Dynamics.GP.eConnect' or one of its dependencies
I get the famous yellow screen of death in my asp.net mvc app after I add both the Microsoft.Dynamics.GP.eConnect, and Microsoft.Dynamics.GP.eConnect.Serialization DLL's.添加 Microsoft.Dynamics.GP.eConnect 和 Microsoft.Dynamics.GP.eConnect.Serialization DLL 后,我在我的 asp.net mvc 应用程序中看到了著名的黄屏死机。 Here is the full error message:
这是完整的错误消息:
Could not load file or assembly 'Microsoft.Dynamics.GP.eConnect' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'Microsoft.Dynamics.GP.eConnect' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Dynamics.GP.eConnect' could not be loaded.
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Stack Trace:
[BadImageFormatException: Could not load file or assembly 'Microsoft.Dynamics.GP.eConnect' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +34
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +16
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38
[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.Dynamics.GP.eConnect' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +736
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +91
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +284
System.Web.Compilation.BuildManager.ExecutePreAppStart() +153
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +521
[HttpException (0x80004005): Could not load file or assembly 'Microsoft.Dynamics.GP.eConnect' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9931916
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
I am using .net framework 4.5 with version 12.0.0.0 of the econnect dll's.我正在使用 .net framework 4.5 和 econnect dll 的 12.0.0.0 版。 Anybody have any ideas?
有人有任何想法吗?
The System.BadImageFormatException exception is the clue here. System.BadImageFormatException 异常是这里的线索。 This is usually when there is a mismatch between 32-bit and 64-bit assemblies.
这通常发生在 32 位和 64 位程序集之间不匹配时。 For example, if IIS is running in 32-bit mode but the solution references the 64-bit 'Microsoft.Dynamics.GP.eConnect' assembly.
例如,如果 IIS 在 32 位模式下运行,但解决方案引用 64 位“Microsoft.Dynamics.GP.eConnect”程序集。
So make sure that you are referencing the correct build of the 'Microsoft.Dynamics.GP.eConnect' assembly.因此,请确保您引用的是“Microsoft.Dynamics.GP.eConnect”程序集的正确版本。 The 64-bit version is installed in "C:\\Program Files\\Microsoft Dynamics\\eConnect 12.0\\API\\" and the 32-bit version is in "C:\\Program Files (x86)\\Microsoft Dynamics\\eConnect 12.0\\API\\"
64 位版本安装在“C:\\Program Files\\Microsoft Dynamics\\eConnect 12.0\\API\\”中,32 位版本安装在“C:\\Program Files (x86)\\Microsoft Dynamics\\eConnect 12.0\\API\\”中”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.