简体   繁体   English

无法加载文件或程序集xxx或其依赖项之一。 试图加载格式错误的程序。

[英]Could not load file or assembly xxx or one of its dependencies. An attempt was made to load a program with an incorrect format.

I get the "Could not load file or assembly xxx or one of its dependencies*********" error when I host my website on a Windows Server 2012 (IIS 8). 当我在Windows Server 2012(IIS 8)上托管网站时,出现“无法加载文件或程序集xxx或其依赖项之一*********”错误。 The xxx here is my project name in my local VS 2015. The application is working perfectly fine in my local PC 此处的xxx是我在本地VS 2015中的项目名称。该应用程序在本地PC上运行良好

It is a VB.NET application with Oracle 12c database as it's backend. 它是一个VB.NET应用程序,具有Oracle 12c数据库作为后端。

Things I have tried till now. 到目前为止,我一直在尝试。 1. Publish with setting the Target CPU as "Any CPU" and Configuration as "Release-Any CPU" - Still the same error. 1.发布时,将目标CPU设置为“任何CPU”,将配置设置为“任何发布CPU”-仍然相同的错误。 2. In the Server IIS, I have set the Enable 32-but apps as True on App's App pool. 2.在服务器IIS中,我已在“应用程序的应用程序池”上将“启用32个但应用程序”设置为“真”。 This is giving a different error. 这给出了另一个错误。 - Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. -无法加载文件或程序集'Oracle.DataAccess'或其依赖项之一。 An attempt was made to load a program with an incorrect format. 试图加载格式错误的程序。

Please help. 请帮忙。

It sounds like your Oracle.DataAccess dll is a 64 bit dll. 听起来您的Oracle.DataAccess dll是64位dll。 You can see what driver is loaded on the web server by navigating in Windows Explorer to the \\windows\\assembly folder. 通过在Windows资源管理器中导航到\\ windows \\ assembly文件夹,可以查看Web服务器上加载了什么驱动程序。 在此处输入图片说明

Most applications that are built with the Any CPU option will have the checkbox in the project settings to prefer 32 bit. 使用“任何CPU”选项构建的大多数应用程序将在项目设置中具有复选框,以偏爱32位。 To avoid this, change your project's platform target to be a 64 bit. 为避免这种情况,请将项目的平台目标更改为64位。

在此处输入图片说明

Then you do not need to "Enable 32 bit" in your application pool and your problem should disappear. 然后,您不需要在应用程序池中“启用32位”,并且问题应该会消失。 Please let me know if this helps. 请让我知道这可不可以帮你。

暂无
暂无

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

相关问题 无法加载文件或程序集“xxx”或其依赖项之一。 试图加载格式不正确的程序 - Could not load file or assembly 'xxx' or one of its dependencies. An attempt was made to load a program with an incorrect format 无法加载文件或程序集“ Oracle.DataAccess”或其依赖项之一。 试图加载格式错误的程序。 缓存 - Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format. Ncache 无法加载文件或程序集“SharpSvn”或其依赖项之一。 尝试加载格式不正确的程序 - Could not load file or assembly 'SharpSvn' or one of its dependencies. An attempt was made to load a program with an incorrect format 无法加载文件或程序集“ MyLibrary”或其依赖项之一。 试图加载格式错误的程序 - Could not load file or assembly 'MyLibrary' or one of its dependencies. An attempt was made to load a program with an incorrect format BadImageFormatException 无法加载文件或程序集或其依赖项之一。 试图加载格式不正确的程序 - BadImageFormatException Could not load file or assembly or one of its dependencies. An attempt was made to load a program with an incorrect format 无法加载文件或程序集“ MWArray”或其依赖项之一。 试图加载格式错误的程序 - Could not load file or assembly 'MWArray' or one of its dependencies. An attempt was made to load a program with an incorrect format 无法加载文件或程序集“...”或其依赖项之一。 试图加载格式不正确的程序 - Could not load file or assembly '...' or one of its dependencies. An attempt was made to load a program with an incorrect format 无法加载文件或程序集“sapnco”或其依赖项之一。 试图加载格式不正确的程序 - Could not load file or assembly 'sapnco' or one of its dependencies. An attempt was made to load a program with an incorrect format 无法加载文件或程序集“Skybound.Gecko”或其依赖项之一。 尝试加载格式不正确的程序 - Could not load file or assembly 'Skybound.Gecko' or one of its dependencies. An attempt was made to load a program with an incorrect format 无法加载文件或程序集“ myApp.Web”或其依赖项之一。 试图加载格式错误的程序 - Could not load file or assembly 'myApp.Web' or one of its dependencies. An attempt was made to load a program with an incorrect format
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM