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:
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:
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