3
votes

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?

1
When you reinstalled Oracle 11g did you select component "Oracle Data Provider for .NET"? - Wernfried Domscheit
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
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
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: oracle.com/technetwork/database/windows/downloads/… - Wernfried Domscheit
You can run the Oracle installer more than only once. There you can check selected components. - Wernfried Domscheit

1 Answers

0
votes

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.