Running Oracle on Windows 2008 R2 64-bits and WCF

4

I'm trying to deploy to a Windows 2008 R2 64-Bits server running AppFabric a WCF 4.0 service that connects to an Oracle 10gR2 database. On my Windows 7 64-Bits, inside Visual Studio 2010, everything goes well. I first started using Oracle ODP.NET and, on deploy, I started getting the:

System.IO.FileNotFoundException: Could not load file or assembly 'Oracle.DataAccess, Version=2.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.
File name: 'Oracle.DataAccess, Version=2.112.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342'

I tried so many things, and nothing seemed to work, and since I'm kinna desperate to get this working, and went to OracleClient, despite the fact that it's marked as deprecated, just to get this working, and buy me time. I removed everything I had installed, but installed just the win64_11gR2_client.zip, with the runtime option. However, than I started getting:

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

So I reinstalled the win64_11gR2_client.zip, adding the Oracle Services for Microsoft Transaction Server component. But then, whenever I made a call to my WCF service, IIS would crash with the error below:

Faulting application name: w3wp.exe, version: 7.5.7601.17514, time stamp: 0x4ce7afa2
Faulting module name: ntdll.dll, version: 6.1.7601.17514, time stamp: 0x4ce7c8f9
Exception code: 0xc0000374
Fault offset: 0x00000000000c40f2
Faulting process id: 0xb28
Faulting application start time: 0x01cc0b141a857fac
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
Report Id: 7630c4b0-7707-11e0-8419-00155d010609

If I tried to change the AppPool to enable 32-bits application, the WSDL doesn't even get generated, and I get the:

A process serving application pool 'MyAppPool' suffered a fatal communication error with the Windows Process Activation Service. The process id was '2856'. The data field contains the error number.

I'm lost, and I don't know what to do. How can it be this hard to do a "simple" and typical Oracle set up? What problem would I try to solve? Does anyone know of a blog post that would show how to correctly set this up? I tried looking, but coudln't find anything, and I'm sure I'm not the only one with this problem
Well, any help would be really appreciated. Tks so much

EDIT

I'm back trying to use the ODP.NET, since of all the problems that came up trying to use Microsoft's OracleClient. I installed OPD.NET2 64 bit on my development machine, on the project's Reference, I removed the 32-bit reference, and manually reference the 64-bits Oracle.DataAccess.dll. Whenever I do this, I'm unable to use the solution on my Dev Machine, since I get the error:

Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.BadImageFormatException: Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format

This is probably due to the fact that it tries to load the 32-bit ODAC, instead of the 64-bit one. But, after I deploy to my 64-bit server, I stop getting the FileNotFoundException, but I start getting:

System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception. ---> Oracle.DataAccess.Client.OracleException: The provider is not compatible with the version of Oracle client
   at Oracle.DataAccess.Client.OracleInit.Initialize()
   at Oracle.DataAccess.Client.OracleConnection..cctor()
   --- End of inner exception stack trace ---
wcf
oracle
iis-7
64-bit
windows-server-2008
asked on Stack Overflow May 5, 2011 by Pascal • edited May 5, 2011 by Pascal

3 Answers

8

I removed the 32-bit reference, and manually reference the 64-bits Oracle.DataAccess.dll. Whenever I do this, I'm unable to use the solution on my Dev Machine, since I get the error:

Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.BadImageFormatException: Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format

I had the same issue on my dev-machine. I checked application pool's settings on IIS and it turned out that "Enable 32-Bit Applications" option had been set to "True". I work on 64-bit applications only, so it was safe for me to set this option to its default value: "False". After that all works fine for me.

You can change this setting in IIS 7 Manager. Right click on the application pool and select "Advanced Settings...". It's in "(General)" group.

answered on Stack Overflow May 26, 2011 by foka
3

Ok, I was able to get it working using the Oracle ODP.Net. Just take the following steps:

  • On the Dev machine, install Oracle's latest ODAC 64bits XCOPY, using something like install.bat all c:\oracle\64 oracle_home
  • On Visual Studio 2010, on the References, remove the Oracle.DataAccess reference that's default, since it's 32-bits. Go to browse, and inside the ODAC's 64 bits installation, you'll find \odp.net\bin\2.x\Oracle.DataAccess.dll. Reference this one
  • Rebuild your solution
  • Since I'm using WCF/IIS/AppFabric, I select Build Deployment Package
  • On the W2k8 R2 64 bits, install the same Oracle ODAC 64 bits ODAC used on the Dev machine
  • Reset IIS
  • To avoid TNS issues, since the full client won't be installed, use the connection string:

    Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=SERVERHOSTNAME)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCLSID)));User Id=user;Password=blablabla;

  • Install the deployment package on IIS/AppFabric as you normally would.

  • Should work out fine

Tks @rlee923 for your help!

answered on Stack Overflow May 6, 2011 by Pascal • edited Jun 5, 2016 by Pascal
2

did u download and install 64 bit version of the client?

it seems like dataaccess oracle dll file is 32bit.

if you haven't I am not sure if there is still a problem with installing 64bit version of the client with R2, but you might have to modify the xml file of the installer to work.

answered on Stack Overflow May 5, 2011 by rlee923

User contributions licensed under CC BY-SA 3.0