Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio ODP Unmanaged Driver - Failed to find the default tnsnames.ora file (12c )

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 ?

enter image description here

like image 302
tapatio Avatar asked Mar 24 '15 13:03

tapatio


2 Answers

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?

like image 96
Angel Olguin Avatar answered Nov 04 '22 10:11

Angel Olguin


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.

like image 23
Christian Shay Avatar answered Nov 04 '22 08:11

Christian Shay