6

We have recently been struggling to update our C# applications with the new Oracle DLLs. We create our software for multiple platforms. So our software solution is both a winform desktop application and a ASP.NET MVC webapplication.

Both applications run Oracle 12.1 stand-alone perfectly. We add all necessary Oracle DLLs with the redistribution of our software. So the desktop application has all the DLLs within the MSI and the publish of the website has all the DLLs in the ~\Bin. Making sure that when the website is hosted on IIS the web application runs. This way our customers do not need to install Oracle Client.

Now comes the problem, since updating to Oracle 12.2 it's not possible for us to run the web application any more. The desktop application still runs fine although since Oracle 12.2 we get a Firewall Exception message, if we want to allow our desktop application to connect to the internet.

We didn’t get that message in Oracle 12.1 or below:

Add firewall rule

We have published our webapplication with all the new Oracle dll’s (the same dll’s as desktop and the same way as for when the webapplication has Oracle 12.1) and since then we are not able anymore to connect to our Oracle databases. We get the error below:

Unable to load DLL 'OraOps12.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'OraOps12.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at Oracle.DataAccess.Client.OpsInit.CheckVersionCompatibility(String version)
   at Oracle.DataAccess.Client.OracleInit.Initialize()
   at Oracle.DataAccess.Client.OracleConnection..cctor()
   --- End of inner exception stack trace ---

We have checked, but YES the DLL is there. We also put it in different locations to see if this would work but no.

These are the DLLs we are using:

Our Oracle DLLs

The strange thing is that when we copy our desktop application to the server, the desktop application runs fine! The desktop application has the exact same DLLs as the web application!

The DLLs we are using for both desktop and web application are from the XCopy folders of Oracle: http://download.oracle.com/otn/other/ole-oo4o/ODAC122010Xcopy_32bit.zip x86 http://download.oracle.com/otn/other/ole-oo4o/ODAC122010Xcopy_x64.zip x64

There are more people struggling with this issue, here is what we have found so far:

  • Oracle 12.2 needs minimum .NET Framework 4.5.2 our server has 4.6 and up
  • The rights of the DLLs are set correctly and may be used by IIS
  • We have for our x86 web application enabled 32-bit application in the Advanced Settings window
  • We have set the environment making sure the right DLLs are added to the environment
  • In Visual Studio we made sure that the references are: Copied if newer and Local copy is set to true
  • Our application are full x86 or x64 NOT anyCPU build.
  • We have checked our Regedit, Machine.config and GAC for any possible left-over of other Oracle versions.
  • Redownloaded the xcopy zip and copied the files again
  • Server has DISABLED firewall (development)

Oracle.DataAccess.Client Dependencies this is more or less our method to!

Our server-specs:

  • Windows Server 2012R2 DataCenter (clean)
  • X64-based pc
  • using IIS 8.5
halfer
  • 19,824
  • 17
  • 99
  • 186
Leroy Meijer
  • 1,169
  • 17
  • 40

1 Answers1

0

This way our customers do not need to install Oracle Client.

I think this is a bad idea, I do not recommend doing it like this.

Either

  • Ask your customer to install Oracle Client (include ODP.NET provider) by themselves using standard Oracle downloads

or

  • Use the ODP.NET Managed Driver, then you don't need any further installation. You just have to provide the Oracle.ManagedDataAccess.dll with your application.

It it hard to determine your problem without further information, there could be several reasons:

  • Missing DLL -> For this I cannot help you, make a normal Oracle installation
  • Wrong PATH settings. -> Ensure %ORACLE_HOME% and %ORACLE_HOME%\bin are in
  • How did you check your GAC? Did you usegacutil.exe version 4.0? Older version 3.5 does not show 4.0 (and above) assemblies.
  • You may have a conflict with 32-bit vs. 64-bit Oracle installation. In case you need both of them, follow this installation instruction: BadImageFormatException. This will occur when running in 64 bit mode with the 32 bit Oracle client components installed
  • Version of ODP.NET does not match with version of installed Oracle Client. The major release (e.g. 11.1, 11.2, 12.1, 12.2) has to be the same for both.

You can also use Process Monitor tool, in order to see which DLL and/or registry entry is missing.

Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110
  • 1
    Why do you think it's a bad idea to not install the Oracle Client? We think it's easier to update our application without any issues to the Oracle version. This still doesn't says why our desktop application works and the webapplication doesn't. Also I used the latest GAC version to check, and also cleard the temporary caching files. – Leroy Meijer Nov 20 '17 at 09:09
  • I think it would be easier for you and likely your current problem would not show up. Did you carefully check the items I listed? – Wernfried Domscheit Nov 20 '17 at 13:00
  • Yes we did, the crazy thing is this all works perfectly for version 4.12.1! Only difference are the dll versions – Leroy Meijer Dec 01 '17 at 08:19
  • 1
    Try to analyze with Process Monitor. Or verify Oracle installation with this tool: https://www.codeproject.com/Tips/1066432/Verify-Oracle-Client-Installation – Wernfried Domscheit Dec 01 '17 at 11:01