首页 > 解决方案 > 当我在服务器上发布项目时,Oracle.DataAccess 程序集错误

问题描述

这是我的情况,我安装了Oracle 11.2.0.3.0 64 位客户端,当我在项目中添加 Oracle ado.Net 文件夹中的 Oracle.DataAccess dll 并在我的机器上编译项目时,如果它可以工作为了我。因此,当我在服务器上发布项目时,我还安装了与我的机器上安装的相同的客户端,该项目对我不起作用,它向我发送一条错误消息:
我必须使用这个版本的 Oracle 来连接到旧版本的 Oracle (Oracle 9i)。

无法加载文件或程序集“Oracle.DataAccess”或其依赖项之一。试图加载格式不正确的程序。


[BadImageFormatException:无法加载文件或程序集“Oracle.DataAccess”或其依赖项之一。试图加载格式不正确的程序。] 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 文件名,字符串 codeBase,证据 assemblySecurity,RuntimeAssembly locationHint,StackCrawlMark 和 stackMark,IntPtr pPrivHostBinder,布尔 throwOnFileNotFound,布尔 forIntrospection,布尔 suppressSecurityChecks)+34 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,

[ConfigurationErrorsException:无法加载文件或程序集“Oracle.DataAccess”或其依赖项之一。试图加载格式不正确的程序。] 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。

[HttpException (0x80004005): 无法加载文件或程序集“Oracle.DataAccess”或其依赖项之一。试图加载格式不正确的程序。] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9969128 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr , HttpContext 上下文)+254


我已经尝试将项目发布为“ Any CPU ”、“ 64bits ”,但它仍然标记相同的错误,你能帮我解决这个问题吗?
在此处输入图像描述


ODAC 11.2
https://www.oracle.com/technetwork/topics/dotnet/downloads/install112030-1440546.html

标签: c#asp.netasp.net-mvcoracleserver

解决方案


推荐阅读