Oracle PATH error - Visual Studio and creating Entity Model

Oracle PATH error - Visual Studio and creating Entity Model

Postby inspectorDev » Tue 12 Jan 2016 17:32

Hello, I am trying to add an ADO.NET Entity Data Model within a new Visual Studio project. We use dotConnect for Oracle. The following used to work before I installed another version of Oracle Client.

I am choosing the "EF Designer From Database" option within the wizard. On the next screen I am creating a "new connection" and choosing the server name and user name and password. But when I click "test connection", I am getting the following error:

"Can not load Oracle Client. Check your PATH Environment variable and registry settings.

Does anyone know how to solve this and why this happened? I am new to Oracle and knowing some basics about how the client/server configuration works would be helpful - in addition to solving the error.

Note- this is what my path looks like from command line:

PATH=C:\oracle\product\11.2.0\client_2\bin;
C:\ProgramData\Oracle\Java\javapath;C:\oracle32\product\11.2.0\client_2;
C:\oracle32\product\11.2.0\client_2\bin;
C:\oracle12.1\product\12.1.0\client_1;
C:\oracle12.1\product\12.1.0\client_1\bin;
C:\oracle12\product\12.1.0\client_1;
C:\oracle12\product\12.1.0\client_1\bin;
C:\oracle\product\11.2.0\client_1;
C:\oracle\product\11.2.0\client_1\bin;
C:\Program Files\Common Files\Microsoft Shared\Windows Live;
C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;
C:\Program Files\Dell\Dell Data Protection\Access\Advanced\Wave\Gemalto\Access Client\v5\;
C:\Program Files (x86)\Security Innovation\SI TSS\bin\;
C:\Program Files (x86)\Windows Live\Shared;
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:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;
c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;
c:\Program Files\Microsoft SQL Server\110\Tools\Binn\;
c:\Program Files\Microsoft SQL Server\110\DTS\Binn\;
c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;
c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;
C:\Program Files\TortoiseSVN\bin;
C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;
C:\Program Files\Microsoft\Web Platform Installer\;
c:\oracle32\product\10.2.0\client_3\bin;
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;
C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\nodejs\;
C:\Program Files\Java\jdk1.8.0_51\bin\;
C:\Windows\System32\WindowsPowerShell\v1.0\;
C:\Program Files\Java\jdk1.8.0_51\bin;
C:\Program Files (x86)\Git\cmd;
C:\Windows\System32\WindowsPowerShell\v1.0\;
C:\Program Files (x86)\WinAnt\bin;
C:\oracle\product\11.2.0\client_2\bin

Thanks
inspectorDev
 
Posts: 19
Joined: Mon 04 Jan 2016 15:04

Re: Oracle PATH error - Visual Studio and creating Entity Model

Postby Pinturiccio » Wed 13 Jan 2016 16:55

When you install Oracle Client on a computer, all the necessary records are added both to the registry and to environment variables automatically. If you perform some changes to your Oracle Client, take the oci.dll library out of the BIN folder or change the corresponding registry or environment variable values, we cannot guarantee that our provider will work with such Oracle Client.
inspectorDev wrote:"Can not load Oracle Client. Check your PATH Environment variable and registry settings.

There are several possible reasons for this error:

1. Information in the registry or environment variables differs from the default one, or the Client itself was modified, as described above.

2. Make sure that the bitness (x86 or x64) of your application and the bitness of your Oracle Client are the same.

If your application is x86, Oracle Client must also be x86. The information about 32bit Oracle Clients can be found in the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ORACLE

If your application is executed as an x64 application, Oracle Client also must be x64. The information about 64bit Oracle Clients can be found in the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE

Since you have used Entity Data Model wizard in Visual Studio, you need x86 Oracle Client.

You also can use the following code in your application in order to find Oracle homes that are available for the application of the current bitness:

Code: Select all
foreach (OracleHome home in OracleConnection.Homes) {
   Console.WriteLine("Name={0} ClientVersion={1} Path={2}", home.Name, home.ClientVersion, home.Path);
}


3. Even when the information in the registry/environment variables is correct and the application tries using the correct Oracle Client, this error may occur when the application is started on behalf of a user with insufficient privileges to access the registry. In this case you need to run your application as Administrator.
Pinturiccio
Devart Team
 
Posts: 1866
Joined: Wed 02 Nov 2011 09:44

Re: Oracle PATH error - Visual Studio and creating Entity Model

Postby inspectorDev » Fri 15 Jan 2016 15:59

Thank you for your reply. However, I don't quite understand what you have said. All we did was perform a new Oracle client installation to get a utility called SQL Loader (sqlldr.dll). After that, the error appears when trying to create an Entity Data Model. It was working fine before.

Here is what the original and latest oracle installation registry settings look like. Does this help you figure out what I can do to fix the error?:

Latest installation after installing sql loader utility:

Image

The corresponding installation in wow6432node:

Image

Previous installation:

Image

Here is the error in visual studio when i test the connection:
Image

What can I do to fix this?
inspectorDev
 
Posts: 19
Joined: Mon 04 Jan 2016 15:04

Re: Oracle PATH error - Visual Studio and creating Entity Model

Postby inspectorDev » Fri 15 Jan 2016 17:14

Also, this is what was produced when I ran your code above:

Name=OraClient10g_home3 ClientVersion=10.2.0.1 Path=C:\oracle32\product\10.2.0\client_3
Name=OraClient11g_home2 ClientVersion=11.2.0.1 Path=C:\oracle32\product\11.2.0\client_2
Name=OraClient12Home1 ClientVersion=12.1.0.0 Path=C:\oracle12.1\product\12.1.0\client_1

Does that make sense?
inspectorDev
 
Posts: 19
Joined: Mon 04 Jan 2016 15:04

Re: Oracle PATH error - Visual Studio and creating Entity Model

Postby inspectorDev » Mon 18 Jan 2016 21:11

Devart team:

Is there any direction you could provide?
inspectorDev
 
Posts: 19
Joined: Mon 04 Jan 2016 15:04

Re: Oracle PATH error - Visual Studio and creating Entity Model

Postby Pinturiccio » Tue 19 Jan 2016 13:44

Since the issue started to occur after installing new Oracle Client, probably its reason is that the new client was installed incorrectly. The latest installed Oracle client becomes the default Oracle Home. This means new Oracle Client is used as Oracle Home when you try to add an ADO.NET Entity Data Model within a new Visual Studio project. Since this Oracle Client works incorrectly with dotConnect for Oracle, you need to select Oracle Client that works.

For this in the "Connection Properties" dialog box click Advanced. In the opened dialog box find the "Home" property and select the Oracle Home, which was used before, and with which connections were established correctly.
Pinturiccio
Devart Team
 
Posts: 1866
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect for Oracle