Oracle 客户端和 IIS 问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2414970/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Oracle client and IIS problems
提问by Igor Brejc
Continuing the discussion about the minimum footprint needed to connect to an Oracle DB from .NET. I've managed to set everything up to work without the installation (just by copying the required files). But when I try to run the code as IIS (7.5) application, I get the following error:
继续讨论从 .NET 连接到 Oracle DB 所需的最小占用空间。我已经设法在没有安装的情况下设置了一切(只需复制所需的文件)。但是当我尝试将代码作为 IIS (7.5) 应用程序运行时,出现以下错误:
[Exception: System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.]
System.Data.OracleClient.OCI.DetermineClientVersion() +264875
System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName) +63
System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions) +133
System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +40
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +29
...
From what I've read, this could be a permissions problem, but I've tried many things (setting access premissions to files, changing the app. pool user, monitoring with ProcMon etc.) to get this to work, but to no avail. Does anybody have any ideas on how to approach this or should I just give up and install the instant client?
从我读过的内容来看,这可能是一个权限问题,但我已经尝试了很多方法(设置文件的访问权限、更改 app.pool 用户、使用 ProcMon 进行监控等)来使其正常工作,但没有有用。有没有人对如何解决这个问题有任何想法,或者我应该放弃并安装即时客户端?
I know about devart's Oracle client, but it's not an option, unfortunately.
我知道devart 的 Oracle 客户端,但不幸的是,这不是一个选项。
采纳答案by Igor Brejc
OK, the solution was to restart the computerafter (re)setting the PATH environment variable to the location of Oracle client files (the 4 DLLs described in the original post). Restarting IIS did not help, I had to restart the whole machine.
好的,解决方案是在(重新)将 PATH 环境变量设置为 Oracle 客户端文件(原始帖子中描述的 4 个 DLL)的位置后重新启动计算机。重新启动 IIS 没有帮助,我不得不重新启动整个机器。