I know there are many questions asked on this same issue. but I couldn't find any solution to my problem. so here is my situation.
In our XBAP application, we use ODP.NET component to access oracle database. It works perfectly in development machine. But when I deploy this in production, I get the following exception while running the application.
Type : System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Message : Could not load file or assembly 'Oracle.DataAccess, Version=4.112.1.2, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.
Here are the system/SW specifications
Development Machine
- 32 bit with XP professional
- .NET 4.0
- 32 bit ODP.NET 11.2.0.3.0
Production Machine
- 64 bit with Windows Server 2008
- .NET 4.0
- 64 bit ODP.NET
I think the application is trying to access 32 bit version of 'Oracle.DataAccess' DLL, but in Visual Studio I have set the target platform to 'Any CPU'. In production IIS, for app pool, enable 32 bit applications is set to 'false'. 64 bit DLL is also present in GAC. So I think the application must use the 64 bit version of 'Oracle.DataAccess' dll but it doesn't.