c# - 探测 privatePath 不起作用

Qua*_*yễn 5 c# database oracle

在 app.config 我正在使用

<configuration>
<configSections>
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
        <section name="SMSGateway.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </sectionGroup>
</configSections>
<startup> 
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <probing privatePath="OracleLibs" />
</assemblyBinding>
</runtime>
</configuration>
Run Code Online (Sandbox Code Playgroud)

在 OracleLibs 子文件夹中加载 dll,但运行程序时出现错误:

OracleConnection 错误:System.TypeInitializationException:“Oracle.DataAccess.Client.OracleConnection”的类型初始值设定项引发异常。---> System.DllNotFoundException: 无法加载 DLL 'OraOps12.dll': 找不到指定的模块。(HRESULT 异常:0x8007007E)

任何人都有解决这个问题的想法。谢谢

Ran*_*ger 0

首先,您引用的是 .dll 吗?

\n\n

其次,这能解决您的问题吗?卸载后Oracle.DataAccess仍尝试访问oraops12.dll

\n\n

第三,这能解决您的问题吗?无法加载 DLL \xe2\x80\x9cOraOps10.dll\xe2\x80\x9d

\n