c# - 当我在服务器上发布项目时,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
解决方案
推荐阅读
- react-native - 使用 npm install -g expo-cli 安装 react native expo 的问题
- c# - MVC 从不同的文件输入上传文件
- deep-learning - 计算训练数据集中迭代的时期数?
- php - 多对多雄辩查询 Laravel
- linux - 用于循环的 bash shell 脚本
- python - 如何在python中将字符串连接为html?
- c++ - 如何在指定的时间内运行循环
- azure - 在提供 azure keyvault 时分配键和值
- python-3.x - 在熊猫中将UTC格式转换为dd/mm/yy hh:mm:ss格式?
- javascript - V8可以安装在嵌入式芯片中吗?