title: ODP.NET Managed library does resolve alias, but 32-bit library does
body: <p>I have 32-bit drivers installed on my box (they were installed and configured by some DBAs)</p>
  
  <p>I wrote a simple script to test the drivers which pretty much is as follows</p>
  
  <pre><code>using (DataTable table = new DataTable())
  {
      using (OracleConnection connection = new OracleConnection())
      {
          connection.ConnectionString = "Data Source=alias;User id=user;Password=password";
          connection.Open();
          using (OracleCommand command = connection.CreateCommand())
          {
              command.CommandType = CommandType.Text;
              command.CommandText = "SELECT * FROM DUAL";
              table.Load(command.ExecuteReader());
          }
      }
  }
  </code></pre>
  
  <p>When I compile this application as 32-bit with the 32-bit Oracle.DataAccess.dll, it executes without a hitch.</p>
  
  <p>However if I compile the application as AnyCPU with the Oracle.ManagedDataAccess.dll, i get an ORA-12154 (could not resolve the connect identifier specified) error.</p>
  
  <p>If I tnsping alias, it works correctly and tells me the connect identifier with the real database name.</p>
  
  <p>If I then change the connection string to use the real database name instead of the alias, and then try with the managed library again, it executes without a hitch.</p>
  
  <p>I've been reading around and found <a href="https://stackoverflow.com/a/20050462/3736051">this</a> answer which says the managed driver relies on the tnsnames.ora file to resolve the aliases, however I rely on LDAP servers defined in sqlnet.ora and ldap.ora.</p>
  
  <p>When I tnsping, it says it uses sqlnet.ora to resolve the name.</p>
  
  <p>So how come the managed drivers do not work?</p>