3

I'm developing a winforms application with oracle database.

Everything worked fine until I had to reinstall oracle 11g. I was able to connect to the database and run my application.

Now I'm receiving the following error:

The procedure entry point ons_subscriber_cancelcallback could not be located in the dynamic link library oraons.dll.

I also have a 12c version installed for another application. My environment variable path is like this:

C:\Oracle\11g\product\11.2.0\client_1;C:\Oracle\11g\product\11.2.0\client_1\bin;C:\Oracle\12c\product\12.1.0\client_1;C:\Oracle\12c\product\12.1.0\client_1\bin;

In my project I'm using the Oracle.DataAccess.dll version 4.112.3.0 that I copied to the folder that contain my .exe file.

The new oracle installation does not have this dll file in the odp.net folder. Could this be the problem? I'm confused about this, because in my project I referenced the dll file inside the project folder that contains the .exe file. So, from my understanding, I believe that is ok.

But right now, I'm lost. I already read tons of forums/blogs saying that the path might be wrong or the Oracle.DataAccess.dll reference, but mine is ok.

Can anyone assist me with this problem, please?

lpfx
  • 1,476
  • 4
  • 18
  • 40
  • When you reinstalled Oracle 11g did you select component "Oracle Data Provider for .NET"? – Wernfried Domscheit Dec 22 '15 at 15:50
  • It is not a good idea to have more than one Oracle Client installed (unless it is only the Instant Client). Why not deinstall everything and install only Oracle 12c? – Wernfried Domscheit Dec 22 '15 at 15:52
  • I believe I selected the component "Oracle Data Provider for .NET", is there a way to check it? And I have to have both versions, I have old softwares that depends on 11g, a winforms application that I'm developing that depends on 11g and a new web api application that depends on 12c managed data provider. – lpfx Dec 22 '15 at 16:06
  • 1
    For ODP.NET Managed Driver you don't have to install full Oracle 12c client. You can download and install ODP.NET Managed Driver separately: http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html – Wernfried Domscheit Dec 22 '15 at 16:06
  • You can run the Oracle installer more than only once. There you can check selected components. – Wernfried Domscheit Dec 22 '15 at 16:08

1 Answers1

0

In your *.csproj, resp. *.vbproj edit your reference to ODP.NET like this:

    <Reference Include="Oracle.DataAccess">
      <SpecificVersion>False</SpecificVersion>
      <Private>False</Private>
    </Reference>

Attributes like Version=... or processorArchitecture=... are not required. Your application will load the correct Oracle.DataAccess.dll depending on selected architecture and target .NET framework.

Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110
  • Deinstall all your Oracle stuff and install only one proper version – Wernfried Domscheit Dec 22 '15 at 17:27
  • 1
    Ok, I deinstalled all 12c stuff and now the error message I'm getting is `Unable to load DLL 'OraOps12.dll'`. It seems like my project is using 12c and not 11g. The dll that it should look for is `OraOps11w.dll` and not `OraOps12.dll`. There is a way to fix it? A project config maybe? – lpfx Dec 22 '15 at 18:38
  • 1
    I said "deinstall **all** your Oracle stuff" not only 12c. Locks like you messed up your Oracle installation, check also this: http://stackoverflow.com/questions/8450726/how-to-uninstall-completely-remove-oracle-11g-client – Wernfried Domscheit Dec 23 '15 at 07:36
  • Sorry. I deinstall **all** oracle stuff and reinstall the 11g. And now it works. But **this** problem was because I used a `Oracle.DataAccess.dll` from 12c to test and I forgot about it. Once I change it back to the right `Oracle.DataAccess.dll` (from 11g) it worked. Thanks. – lpfx Dec 23 '15 at 13:02
  • Can you add an answer about the installation problem so I can accepted it? – lpfx Dec 23 '15 at 13:03