简体   繁体   English

在Windows Server 2012 r2上部署时出现BadImageFormatException

[英]BadImageFormatException when deploying on windows server 2012 r2

I am deploying my Asp.net application on Windows Server 2012 R2(x64). 我正在Windows Server 2012 R2(x64)上部署我的Asp.net应用程序。 I get a runtime BadImageFormatException while using 64-bit dll. 使用64位dll时,我得到一个运行时BadImageFormatException。 When I run it with IIS Express or application published on local machine IIS everything works well (Application pools -> solution name -> Enable 32-bit applications set to False, All projects in solution are also set for Platform target x64). 当我使用IIS Express或在本地机器上发布的应用程序运行它时,一切运行良好(应用程序池 - >解决方案名称 - >启用32位应用程序设置为False,解决方案中的所有项目也设置为Platform target x64)。 Deploy is going through Team City & Octopus Deploy. 部署正在通过Team City和Octopus Deploy进行。

What the solution could be? 解决方案可能是什么?

UPD System.BadImageFormatException: An attempt was made to load a program with an incorrect format. UPD System.BadImageFormatException:尝试加载格式不正确的程序。 (Exception from HRESULT: 0x8007000B) at libxl.XmlBook.xlCreateXMLBookC() at xxx.Controllers.xxx.xxxController.LibxlTest() in C:\\TeamCity\\buildAgent\\work\\aeb63fe0b246a1f3\\xxx\\xxx\\Controllers\\xxx\\xxx\\xxxController.cs:line 597 (来自HRESULT的异常:0x8007000B)位于libxl.XmlBook.xlCreateXMLBookC()的xxx.Controllers.xxx.xxxController.LibxlTest()位于C:\\ TeamCity \\ buildAgent \\ work \\ aeb63fe0b246a1f3 \\ xxx \\ xxx \\ Controllers \\ xxx \\ xxx \\ xxxController .cs:597行

There is no such path C:\\TeamCity\\buildAgent\\ on server whrere the Octopus Tentacle is. 在Octopus触手上的服务器上没有这样的路径C:\\ TeamCity \\ buildAgent \\。

Finally, it works with x86 (from bin folder) version while the solution was build for x64. 最后,它适用于x86(来自bin文件夹)版本,而解决方案是为x64构建的。 Probably, it is a peculiarity of libxl . 可能,这是libxl一个特点。 Thus, I'm developing with x64 and after deploy my post-deploy script changes it for x86 version. 因此,我正在使用x64进行开发,在部署之后,我的部署后脚本会将其更改为x86版本。

OK, it looks like you or one of your references has a dependency on libXL . 好的,看起来您或您的某个引用对libXL有依赖性。

Your exception result ( 0x8007000B ) is definitely a 32-bit can't load on 64-bit issue. 您的异常结果( 0x8007000B )肯定是32位无法在64位问题上加载。

libXL is C++ project, in the download zip there's a bin64 folder with a copy of libxl.dll that will work in 64-bit mode. libXL是C ++项目,在下载zip中有一个bin64文件夹,其中包含一个libxl.dll副本,可以在64位模式下运行。

If you have a libXL licensed copy better to use the 64-bit dll from that. 如果你有一个libXL许可副本更好地使用64位DLL。

Note that C:\\TeamCity\\buildAgent\\ comes from the machine your project was built on, the line numbers etc get saved into your pdb files. 请注意, C:\\TeamCity\\buildAgent\\来自您的项目所在的机器,行号等保存到您的pdb文件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Blazor 问题部署到 Windows 服务器 2012 R2 — 运行 Visual Studio 2019 - Blazor problem deploying to Windows server 2012 R2 — running Visual Studio 2019 Windows Server 2012 r2 中的波斯文化 - Persian culture in Windows Server 2012 r2 Windows Server 2012 R2上Windows Service Platform上的WCFNotSupportedException - WCF on Windows Service PlatformNotSupportedException On Windows Server 2012 R2 在 Windows Server 2012 R2 上构建的应用程序在 Windows Server 2008 R2 上失败 - Application built on Windows Server 2012 R2 fails on windows server 2008 R2 Windows Server 2012 R2上的意外崩溃WCF服务 - Unexpected crash WCF Service on Windows Server 2012 R2 Active Directory中的用户身份验证-Windows Server 2012 R2 - User Authentication in Active Directory - Windows Server 2012 R2 在Windows Server 2012 R2上发送http / 2请求 - send http/2 request on windows server 2012 R2 无法在 Windows 2012 R2 服务器上加载 DLL“tensorflow” - Unable to load DLL 'tensorflow' on Windows 2012 R2 Server 将 .net core 项目部署到 Windows Server 2012 r2 - Deploy .net core project to Windows Server 2012 r2 ServicePointManager.ServerCertificateValidationCallback无法在Windows Server 2012 R2上运行 - ServicePointManager.ServerCertificateValidationCallback not working on Windows Server 2012 R2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM