Oracle9i connection error (ora-12154) in .NET application only on some machines

2

I made a .NET(4.6.1) application that connects to an Oracle9i Database. This application works fine on the machine I wrote the application on but not on the machine where the application needs to be installed on.

I'm using System.Data.OracleClient. I have no idea what could be wrong. I checked the following things.

  • Both machines run the same oracle client with the same TNS names configuration. This configuration is copied from the development machine where it is working.
  • Both machines call for the correct tnsnames.ora file (Validated using procmon).
  • Both machines can connect with SQLPlus just fine.
  • Both machines are tested with the same active directory account.
  • Both machines have the correct username and password setup for the connection.
  • I tried fresh install of the oracle client without success.
  • The application is running in 32 mode on both machines.
  • Both machines run the same version of Windows 7

Anyone know what else could be the cause of this problem?

Stacktrace of the error:

2017-10-05 16:40:48.7203 - ERROR: System.Data.OracleClient.OracleException (0x80131938): ORA-12154: TNS:servicenaam kon niet worden herleid.

   bij System.Data.OracleClient.OracleException.Check(OciErrorHandle errorHandle, Int32 rc)
   bij System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName)
   bij System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions)
   bij System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
   bij System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
   bij System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
   bij System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
   bij System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
   bij System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   bij System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   bij System.Data.OracleClient.OracleConnection.Open()
   bij QardPrint.Model.Locus.LocusFunctions.AddEmployee(Employee employee, String& errMsg)
.net
windows-7
oracle9i
system.data.oracleclient
ora-12154
asked on Stack Overflow Oct 6, 2017 by Mark Baijens • edited Oct 6, 2017 by Mark Baijens

1 Answer

0

I finally "solved" the issue. For some reason the oracle connection did not work on the target machine if my program was installed in the Program Files(x86) folder. However on my development machine it did work in this folder. It's still unclear to me why this is. If anyone knows the reason behind this please leave an answer.

answered on Stack Overflow Oct 18, 2017 by Mark Baijens

User contributions licensed under CC BY-SA 3.0