我有一个从 asp.net 1.1 (VS 2003) 迁移到 Asp.net 2 (VS 2008) 的 Web 应用程序。 我在新版本上执行 Oracle connexion 时遇到问题。开发环境是 64 位七。当使用所有 CPU 生成应用程序时,我在 System.Data.OracleClient 上遇到问题,异常 System.BadImageFormatException: Tentative de chargement d'un program de format incorrect. (HRESULT 异常:0x8007000B)。 .我在 x86 CPU 上生成,但在启动时出现此错误:
[BadImageFormatException: Impossible de charger le fichier ou l'assembly 'CpimWebApplication' ou une de ses dépendances. Tentative de chargement d’un programme de format incorrect.]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +416
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +166 System.Reflection.Assembly.Load(String assemblyString) +35
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +190
有什么问题吗?机器上的 Oracle Client 是 32 位版本。 我在 web 上看到无法将 System.data.OracleClient 与 32 位 oracle Client 一起使用?安装 64 位 Oracle 客户端是解决方案吗? TIA 问候
最佳答案
如果您在 64 位模式下运行应用程序,则无法使用 32 位 Oracle 驱动程序。
您需要安装 64 位 Oracle 驱动程序并以 64 位模式运行您的应用程序,
或
将应用程序设置为以 32 位模式运行。您可以在 IIS 中通过选择您的应用程序池、转到高级设置并将“启用 32 位应用程序”设置为真来执行此操作。
关于.net - 7 个 64 位操作系统上带有 32 位 oracle 客户端驱动程序的 System.data.OracleClient,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8433803/