Running Oracle on Windows 2008 R2 64-bit and WCF

I am trying to deploy to a Windows 2008 R2 64-bit server running AppFabric the WCF 4.0 service that connects to the Oracle 10gR2 database. On my 64-bit Windows 7 computers inside Visual Studio 2010, everything is going well. First, I started using Oracle ODP.NET, and when deploying, I started getting:

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 desperately need to get this to work, I went to OracleClient even though it was marked as deprecated, just to make it work and buy me time. I uninstalled everything that I installed, but installed only 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 win64_11gR2_client.zip, adding the Oracle Services for Microsoft Transaction Server component. But then, whenever I called my WCF service, IIS would fail 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 AppPool to include a 32-bit application, WSDL is not even generated, and I get:

 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 am lost and I do not know what to do. How can it be so difficult to make a "simple" and typical Oracle? What problem would I try to solve? Does anyone know of a blog post that will show how to properly configure this? I tried to look, but did not find anything, and I'm sure that I'm not the only one with this problem
Well, any help would be really appreciated. Tks so much

EDIT

I am trying again to use ODP.NET, because of all the problems that occurred while trying to use Microsoft OracleClient. I installed the 64-bit OPD.NET2 bit on my development machine, in the Reference project, I deleted the 32-bit link and manually referenced the 64-bit Oracle.DataAccess.dll. Whenever I do this, I cannot use the solution on my Dev Machine, as I get an 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 he is trying to load 32-bit ODAC, and not into 64-bit. But after deployment on my 64-bit server, I stop receiving FileNotFoundException, but I start receiving:

 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 --- 
+4
source share
3 answers

Ok, I managed to get it working using Oracle ODP.Net. Follow these steps:

  • On a Dev machine, install Oracle ODAC 64bit XCOPY using something like install.bat all c:\oracle\64 oracle_home
  • In Visual Studio 2010, in the links, remove the default Oracle.DataAccess link because it is 32-bit. Go to the overview and inside the installation of 64-bit ODAC you will find \ odp.net \ bin \ 2.x \ Oracle.DataAccess.dll. Link to it
  • Recover your decision
  • Since I use WCF / IIS / AppFabric, I choose the Build Deployment Package
  • On the 64-bit version of W2k8 R2, install the same Oracle ODAC 64-bit ODAC that is used on the Dev machine.
  • Reset iis
  • To avoid problems with TNS, since the full client will not 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 in IIS / AppFabric, as usual.

  • Should work fine

Tks @ rlee923 for your help!

+3
source

I deleted the 32-bit link and manually referenced the 64-bit Oracle.DataAccess.dll. When I do this, I cannot 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 problem on my dev machine. I checked the application pool settings in IIS, and it turned out that the Enable 32-bit Applications option was set to True. I only work with 64-bit applications, so it was safe for me to set this default parameter: "False". After that, everything works fine for me.

You can change this setting in IIS Manager 7. Right-click the application pool and select "Advanced Settings ...". This is in the "(General)" group.

+8
source

Download and install the 64-bit version of the client?

It seems that the oracle dll dataccess file is 32 bits in size.

If you don’t, I’m not sure that there is still a problem installing the 64-bit version of the client with R2, but you may need to modify the installer xml file to work.

+2
source