I have built a small WinForms application and am using the ODP.NET Managed Driver to connect to an Oracle database. I have followed the instructions in this document to set up the connection using the application.config file:
Based on documentation I found in several places I was under the impression that the application.config file has the highest priority with respect to the database alias resolution. Eg: https://docs.oracle.com/cd/E48297_01/doc/win.121/e41125/featConfig.htm#autoId6
However what I am experiencing is that if the TNS_ADMIN environment variable exists it has a higher priority than the data source alias in the 'dataSources' section in the .NET config file. I know that the TNS_ADMIN setting is one option for configuring the connection but I have not configured this setting in my application.config file.
The last 2 posts in this thread seem to be referring to the same issue that I am experiencing. https://community.oracle.com/message/10610812#10610812
The last post claims that the issue would be due to TNS_ADMIN being defined in machine.config settings and that this overrides everything else. However this contradicts the documentation here: https://docs.oracle.com/cd/E48297_01/doc/win.121/e41125/featConfig.htm#autoId4
I also tried searching all 4 of my machine.config files and was unable to find any references to TNS_ADMIN. So while in my case TNS_ADMIN location is definitely being prioritized I am unable to find a reference to the TNS_ADMIN variable.
Is the official precedence order that I posted in the second link above accurate? What about the machine.config? Where should I be looking for references to the TNS_ADMIN variable?