views:

31

answers:

1

I have developed a C# 3.5 Mvc 1.0 application using oracle 11gR2 client which uses odp .net 2.112.1.0. I want to deploy it in my IIS7 server which has oracle client 10g which uses odp.net 2.102.2.20 . I am getting the following error

Could not load file or assembly 'Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.

I tried copying the 11g Oracle.DataAccess.dll to the bin folder of my project then it gives the following error

The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception.

+1  A: 

The easiest way is to install the the oracle odp.net package 11.2.0.1.2 with Xcopy Deployment. This installs an instant client, check the readme.txt for installation instructions.
But I have found out that the current xcopy package doesn't support 64bit which is due in November. The workaround is to build your assembles for x86 target platform. This only applies if you are deploying to windows server 2008 x64. It is not sufficient to copy the Oracle.DataAccess.dll.

Pratik
Yes my IIS server runs on 2008 x64. I will try out the xcopy deployment and let you know
Kanishka
One more thing, will my 10g client get effected because there are other websites on the server which were built using odp.net 2.102.2.20.
Kanishka
It should not, but for production scenario you should have a similar staging environment to test it out. Actually I believe it will install policy assemblies in GAC that will redirect all calls to earlier versions (2.102.2.20) to the newer version. In theory this should be all right but you should have basic regression tests of the other websites just to be sure.
Pratik