A simple console application open connection without problems:
static void Main(string[] args) { string connectionString = String.Format( @"Provider=OraOLEDB.Oracle;PLSQLRSet=1;Password={0};Persist Security Info=True;User ID={1};Data Source={2};OLEDB.NET=true;FetchSize=5000", "pwd", "schema", "server"); using (IDbConnection con = new OleDbConnection(connectionString)) { con.Open(); Console.WriteLine("Opened"); } Console.ReadKey(); }
but if you try to do the same in the nunit method:
public class UnitTest1 { [Test] public void TestMethod1() { string connectionString = String.Format( @"Provider=OraOLEDB.Oracle;PLSQLRSet=1;Password={0};Persist Security Info=True;User ID={1};Data Source={2};OLEDB.NET=true;FetchSize=5000", "pwd", "schema", "server"); using (IDbConnection con = new OleDbConnection(connectionString)) { con.Open(); } } }
I have an exception: ORA-12154: TNS: could not determine the specified connection identifier
Obviously, the problem is in the environment.
How to configure "nunit" to use the "same" settings, such as a console application
some components:
target structure: 4.0 target platform: x86 nunit 2.5.9 OS: Windows 7 x64
source share