Page 1 of 1

Cannot load Oracle client. Check your PATH environment variable and registry settings

Posted: Fri 21 Sep 2018 03:35
by chpang
i am using Devart.Data.Oracle.EFCore(9.6.584)

i had install my oracle client 64 bit at location C:\Oracle\ora64

Code: Select all

foreach (OracleHome home in OracleConnection.Homes)
{
       string printf = string.Format("Name={0} ClientVersion={1} Path={2}", home.Name, home.ClientVersion, home.Path);
}
i had run above code and the result as below:
Name=ORA64 ClientVersion=11.2.0.1 Path=C:\Oracle\ora64


Could any1 please advise what else should i check ?

my PATH enviroment Variable :

C:\Oracle\ora64;C:\Oracle\ora64\bin;C:\ProgramData\Oracle\Java\javapath;C:\Oracle\product\11.2.0\client_1;C:\Oracle\product\11.2.0\client_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Tools\nant\bin;C:\Program Files\Python27;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft DNX\Dnvm\;C:\Oracle\ora32;C:\Oracle\ora32\bin;C:\Program Files\nodejs\;%systemroot%\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;%systemroot%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\dotnet\;C:\Program Files\dotnet\





this is the error message

Devart.Data.Oracle.OracleException
HResult=0x80004005
Message=Cannot load Oracle client. Check your PATH environment variable and registry settings.
Source=Devart.Data.Oracle
StackTrace:
at   ..ctor(Boolean , Boolean , OracleHome )
at   .(Boolean , Boolean , OracleHome , Boolean , Boolean )
at   ..ctor(   ,    )
at   .    (  , Object , DbConnectionBase )
at  .(  ,   , DbConnectionBase )
at  .(DbConnectionBase )
at  .(DbConnectionBase )
at  .(DbConnectionBase )
at  .    (DbConnectionBase )
at Devart.Common.DbConnectionBase.Open()
at Devart.Data.Oracle.OracleConnection.Open()
at   .(DbConnection , OracleServerType& , Nullable`1& )
at   .(DbConnection )
at   .     ​(RelationalOptionsExtension )
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at   ..ctor(RelationalTypeMapperDependencies ,    )
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)

Re: Cannot load Oracle client. Check your PATH environment variable and registry settings

Posted: Wed 26 Sep 2018 10:12
by Pinturiccio
Do you get this error in the same application when you get information about Oracle home or is it another one?

Please create the following application:

Code: Select all

static void Main(string[] args)
{
    foreach (OracleHome home in OracleConnection.Homes)
    {
        string printf = string.Format("Name={0} ClientVersion={1} Path={2}", home.Name, home.ClientVersion, home.Path);
        Console.WriteLine(printf);
    }
    OracleConnection conn = new OracleConnection("Your connection string");
    conn.Open();
    Console.WriteLine(conn.ServerVersion);
    conn.Close();
}
What are the results of the execution of this package? Do you get home info and successfully connect or other results?

Re: Cannot load Oracle client. Check your PATH environment variable and registry settings

Posted: Thu 27 Sep 2018 09:46
by chpang
Hi i had try your code, the error "Cannot load Oracle client. Check your PATH environment variable and registry settings" raised when the Oracle Connection open.

Re: Cannot load Oracle client. Check your PATH environment variable and registry settings

Posted: Thu 27 Sep 2018 11:05
by chpang
just added more infor here :

Code: Select all

Oracle.ManagedDataAccess.Client.OracleConnection Newconnection = new Oracle.ManagedDataAccess.Client.OracleConnection("My Connection String");
Newconnection .Open();
Console.WriteLine(Newconnection.ServerVersion);
Newconnection.Close();
i had successfully run the aboved code. i can get the server version 12.2.0.1.0


any idea why its doesn't success if using DevArt Oracle Connection ?

Re: Cannot load Oracle client. Check your PATH environment variable and registry settings

Posted: Thu 27 Sep 2018 14:40
by Pinturiccio
chpang wrote:Oracle.ManagedDataAccess.Client.OracleConnection
Thank you for this test. This information is helpful.
chpang wrote:Hi i had try your code, the error
Do you get server version before the error?

Re: Cannot load Oracle client. Check your PATH environment variable and registry settings

Posted: Fri 28 Sep 2018 02:30
by chpang
Do you get server version before the error?
Nope. i could not get the server version before the error. the error raise when the conn.Open();

The error message are too general.Do we had any way to Debug or get more usefull exception in DevArt.Data.Oracle.EFcore ?

Re: Cannot load Oracle client. Check your PATH environment variable and registry settings

Posted: Mon 01 Oct 2018 10:38
by Pinturiccio
We are sorry for the incorrect question. We mean information about the home that you get from the foreach cycle. Do you get this information before the error?

Re: Cannot load Oracle client. Check your PATH environment variable and registry settings

Posted: Wed 03 Oct 2018 17:33
by chpang
Yes

Re: Cannot load Oracle client. Check your PATH environment variable and registry settings

Posted: Mon 08 Oct 2018 16:31
by Shalex
1. Right click on your project in Solution Explorer > Properties and specify your values of these settings:
a) Application > "Target framework"
b) Build > "Platform target" and "Prefer 32-bit"

2. Is capacity of your Oracle Client x86 or x64?

3. Run your project in the debug mode, navigate to Debug > Windows > Modules and tell us the Path values of Devart.* assemblies loaded in the process of your application.

4. Give us your connection string (roughly, without a confidential information).

Re: Cannot load Oracle client. Check your PATH environment variable and registry settings

Posted: Tue 09 Oct 2018 03:41
by chpang
Thanks for you help. I UnInstalled and re-install the Oracle client and its work. but still , i could not get a useful exception message that help on debug.

Re: Cannot load Oracle client. Check your PATH environment variable and registry settings

Posted: Tue 09 Oct 2018 10:55
by Shalex
chpang wrote: Tue 09 Oct 2018 03:41i could not get a useful exception message that help on debug
Please specify the exact message and full stack trace of your current exception.