title: Why would Oracle.ManagedDataAccess not work when Oracle.DataAccess does?
body: <p>I'm developing a very simple application which I intend to use to troubleshoot an issue I am having on a few machines but before I even got that far I ran into a few issues, including cpu architecture differences and Oracle database libraries.</p>
  
  <p>I have a database server listed in <code>tnsnames.ora</code>, sitting in my <code>C:\oracle\11g\network\admin</code> directory. If I tnsping this server I get the desired response. If I code my C# program to connect to this server with the following code using Oracle.DataAccess.Client, it works.</p>
  
  <pre><code>string connectionString = "Data Source=DSDSDS;User Id=UNUNUN;Password=PWPWPW;";
  DataTable dataTable = new DataTable();
  
  using (var connection = new OracleConnection(connectionString)) {
      connection.Open();
      using (var command = new OracleCommand()) {
          command.Connection = connection;
          command.CommandText = sql;
          command.CommandType = CommandType.Text;
          using (var oda = new OracleDataAdapter(command)) {
              oda.Fill(dataTable);
          }
      }
  }
  </code></pre>
  
  <p>However Oracle.DataAccess is dependent on the architecture of the system it runs on. I saw that there is another library Oracle.ManagedDataAccess which is architecture independent. When I use this library it no longer is able to connect to the server. An <code>ORA-12545: Network Transport: Unable to resolve connect hostname</code> is thrown.</p>
  
  <p>Why is this the case? What is different between these two libraries because based upon what I've read thus far this shouldn't be an issue.</p>
  
  <p>Extra information:</p>
  
  <ul>
  <li>%ORACLE_HOME% and %TNS_ADMIN% are NOT defined (remember that tnsping and Oracle.DataAccess work)</li>
  <li>PATH has <code>C:\oracle\11g\BIN</code> defined.</li>
  <li>My machine only has one <code>tnsnames.ora</code> file</li>
  </ul>
  
  <p>If I move tnsnames.ora to the same location as my .exe file, it works. Why can Oracle.DataAccess find tnsnames.ora in the <code>C:\oracle\11g\network\admin</code> directory but Oracle.ManagedAccess cannot?</p>