Can ODP.NET support LDAP with the Entity Frameworks tools?

断了今生、忘了曾经 提交于 2021-01-29 10:12:35

问题


Does anyone know if ODP.NET Managed Access (Oracle.ManagedDataAccess 12.2) support LDAP with the Entity Frameworks tools (vs 2017 Entity Framework 6.2)? The DBA inhibited access through TNS, so I no longer unable to connect to database to update the data models. The error message I received was ORA-12154 TNS could not resolve the connect identifier specified.

I tried to include the LDAPSetting in the app.net, but that didn't work. Is there any way I could still use the Entity Framework tools to update these data models?


回答1:


Most likely the ODP.NET Managed Driver does not find your sqlnet.ora and ldap.ora files.

Did you set NAMES.DIRECTORY_PATH = (LDAP, ...) in your sqlnet.ora file?

You can define location of sqlnet.ora and ldap.ora files also by TNS_ADMIN environment variable or in machine.config with a script similar to this:

set TNS_ADMIN=C:\oracle\network\admin

set Oracle_x64=c:\oracle\product\12.2\Client_x64\odp.net
"%Oracle_x64%\managed\x64\OraProvCfg.exe" /action:config /product:odpm /frameworkversion:v4.0.30319 /providerpath:%Oracle_x64%\managed\common\Oracle.ManagedDataAccess.dll /set:settings\TNS_ADMIN:%TNS_ADMIN%


set Oracle_x86=c:\oracle\product\12.2\Client_x86\odp.net
"%Oracle_x86%\managed\x86\OraProvCfg.exe" /action:config /product:odpm /frameworkversion:v4.0.30319 /providerpath:%Oracle_x86%\managed\common\Oracle.ManagedDataAccess.dll /set:settings\TNS_ADMIN:%TNS_ADMIN%

If it does not help, here would be a workaround: ODP.NET Managed library does resolve alias, but 32-bit library does. However, on my machine LDAP resolution works fine with ODP.NET Managed Driver. Perhaps have also a look at Oracle Data Provider for .NET, Managed Driver Configuration



来源:https://stackoverflow.com/questions/52271114/can-odp-net-support-ldap-with-the-entity-frameworks-tools

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!