[英]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: 对我来说,最终帮助了以下步骤:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.