In my configuration, an Entity Framework 6-based.NET application created with Visual Studio 2015 is attempting to retrieve data from an Oracle 12c database.
I performed the following to do that:
Here is how my App.config looks (line breaks have been added to make it easier to read):
<oracle.manageddataaccess.client> <version number="*"> <settings> <setting name="TraceLevel" value="7" /> <setting name="TraceOption" value="0" /> <setting name="TraceFileLocation" value="C:\Temp" /> <setting name="TNS_ADMIN" value="c:\Temp\tns" /> </settings> </version> </oracle.manageddataaccess.client> <connectionStrings> <add name="MyModel" connectionString="metadata=res://*/UDBModel.csdl|res://*/UDBModel.ssdl|res://*/UDBModel.msl; provider=Oracle.ManagedDataAccess.Client; provider connection string="User Id=*****;Password=*****;Data Source=MYDATASOURCE.WORLD;"" providerName="System.Data.EntityClient" />
This fails while attempting to access the database, with the following exception:
"ORA-12533: Netzwerksession: Syntaxfehler bei Verbindungstransportadresse"
which the oracle docs says translated to
"ORA-12533: TNS: illegal ADDRESS parameters"
The trace log demonstrates that the tnsnames.ora is appropriately resolved.
The connection is successful when the IP address and port are used in place of the TNS name. However, because our company's database administrators maintain tnsnames.ora, contacting the servers by their IP addresses is not an option.
I should also point out that with this configuration, older drivers (such the Oracle.DataAccess.dll) have no issues accessing the database.
EDIT: This is the tnsnames.ora file as I currently use it:
MYDATASOURCE.WORLD = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = MYDATASOURCE)) (ADDRESS = (COMMUNITY = TCP.world)(PROTOCOL = TCP)(Host = myds.example.com)(Port = 1530))) (CONNECT_DATA = (SID = MYDATASOURCE)) )
Why am I doing this wrong?
NB: There are more questions like this. The remedies that worked in those situations did not work here, and the exception there was different from the one here:
ODP.NET Managed Driver, I presume, cannot locate your
ODP.NET Managed Driver resolves the alias in the following order:
<oracle.manageddataaccess.client>part of the.NET configuration file.
tnsnames.orafile at the address provided by
TNS_ADMINthe.NET configuration file. Both absolute and relative directory paths may be included in locations.
tnsnames.oraa file that is located in the same directory as the
You can see that the ODP.NET Managed Driver doesn't examine environment variables to determine the value of
. Examine the.NET configuration files (i.e.
Oh, and you can run.
to get errors in English. Additionally, you may set this in your Registry at