I'm developing an app in Visual Studio 2013 that connects to a Oracle Database. I have to use the "Unmanaged Driver". When I'm trying to create a new connection in a dataset, when I chose the "Managed Driver" all work fine: the tnsnames.ora is found. But when I select the "Unmanaged driver" all fails, it send me a message like " Failed to find the default tnsnames.ora file"
I already - Uninstalled all old Oracle Clients - Clean all environment variables - Reinstalled Oracle client, ODP tools for Visual Studio
Nothing seems to work. Any ideas ?
you should go to the folder containing the machine.config file. this file is found in %windir%\Microsoft.NET\Framework64\[version]\config\machine.config
make sure you have the following value.
<oracle.manageddataaccess.client>
<version number="4.121.2.0">
<settings>
<setting name="TNS_ADMIN"value="E:\app\client\USERWINDOW\product\12.1.0\client_1\network\admin" />
</settings>
</version>
</oracle.manageddataaccess.client>
Also, refer to this post on Where Is Machine.Config?
You can ignore that message and simply use EZ Connect to connect (providing host, port, service_name).
Or you can find a valid TNSNAMES.ORA with your aliases in it, and copy it to: [ORACLE_HOME_WHERE_ODT_IS_INSTALLED]\NETWORK\ADMIN
Since Managed Driver can find TNSNAMES.ORA this means that TNS_ADMIN is set in the machine.config. When you connect using managed provider, the connection dialog will show you where it is finding the TNSNAMES.ORA and you can copy it over.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With