简体   繁体   English

System.DllNotFoundException:发布到IIS时无法加载DLL'oci'

[英]System.DllNotFoundException: Unable to load DLL 'oci' when published to IIS

I have a .net core application and I have to use System.Data.OracleClient.dll to connect with oracle db. 我有一个.net核心应用程序,必须使用System.Data.OracleClient.dll与oracle db连接。

Everything works when I run this in VS2017 but when I publish and try to run the part that connects to the database I get an error: 当我在VS2017中运行此命令时,一切正常,但是当我发布并尝试运行连接到数据库的部分时,出现错误:

System.DllNotFoundException: Unable to load DLL 'oci': The specified module could not be found. System.DllNotFoundException:无法加载DLL'oci':找不到指定的模块。 (Exception from HRESULT: 0x8007007E) at System.Data.OracleClient.Oci.OciCalls.OciNativeCalls.OCIEnvCreate(IntPtr& envhpp, OciEnvironmentMode mode, IntPtr ctxp, IntPtr malocfp, IntPtr ralocfp, IntPtr mfreep, Int32 xtramem_sz, IntPtr usrmempp) (来自HRESULT的异常:0x8007007E)位于System.Data.OracleClient.Oci.OciCalls.OciNativeCalls.OCIEnvCreate(IntPtr&envhpp,OciEnvironmentMode模式,IntPtr ctxp,IntPtr malocfp,IntPtr ralocfp,IntPtr mfreep,IntPtr mfreep

Am I missing some kind of IIS module? 我是否缺少某种IIS模块? I have x64 bit oracle in same PC. 我在同一台PC中有x64位Oracle。

可能是您缺少了OciCalls类调用的本机代码(可能是某些本机dll或类似的dll),或者找不到它在所查找的位置,无论如何,您都可以使用Assembly Binding Log Viewer对其进行调试以查看其位置探测以及缺少的东西。

For me finally helped following steps: 对我来说,最终帮助了以下步骤:

  1. Got x86 Oracle Instant client from ( http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html ) 从( http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html )获得了x86 Oracle Instant Client
  2. Added instant client folder to environment path to the first position so that it will precede all other oracle paths. 将即时客户端文件夹添加到环境路径的第一个位置,以便它将在所有其他Oracle路径之前。
  3. Restarted machine. 重新启动机器。

暂无
暂无

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

相关问题 System.DllNotFoundException:部署到Docker Linux容器时无法加载DLL'oci' - System.DllNotFoundException: Unable to load DLL 'oci' when deployed to a Docker Linux container System.DllNotFoundException:无法加载DLL'i2c.so' - System.DllNotFoundException: Unable to load DLL 'i2c.so' System.DllNotFoundException:无法在窗口 2003 上加载 DLL - System.DllNotFoundException: Unable to load DLL on window 2003 System.DllNotFoundException: 无法加载 DLL 'SqlServerSpatial110.dll': 找不到指定的模块 - System.DllNotFoundException: Unable to load DLL 'SqlServerSpatial110.dll': The specified module could not be found .NET DLL中的System.DllNotFoundException - System.DllNotFoundException in .NET DLL System.DllNotFoundException:无法加载 DLL 'cvextern':找不到指定的模块 - System.DllNotFoundException:Unable to load DLL 'cvextern': The specified module could not be found System.DllNotFoundException:无法加载DLL。 Dev机器中没有错误,但目标机器中有错误 - System.DllNotFoundException: Unable to load DLL. No errors in Dev machine but error in target machines Visual Studio2012。---> System.DllNotFoundException:无法加载DLL'OraOps12.dll':找不到指定的模块 - Visual Studio 2012. ---> System.DllNotFoundException: Unable to load DLL 'OraOps12.dll': The specified module could not be found System.DllNotFoundException:'无法加载 DLL'libwkhtmltox':找不到指定的模块。 (来自 HRESULT 的异常:0x8007007E)' - System.DllNotFoundException: 'Unable to load DLL 'libwkhtmltox': The specified module could not be found. (Exception from HRESULT: 0x8007007E)' System.DllNotFoundException'发生在 WindowsBase.dll - System.DllNotFoundException' occurred in WindowsBase.dll
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM