0

I have installed Oracle 11.2.0.1 64 bit version in windows 7 64 bit machine. When i try to connect Oracle DB through C# console application(VS2012) its working fine when i choose platform target as AnyCPU/X64 its working fine. If i choose X86 it shows the below error

Could not load file or assembly 'Oracle.DataAccess, Version=2.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. An attempt was made to load a program with an incorrect format.

It's correct i have installed the X64 version dll and it shows error when i try to run in 32 bit mode.

When i integrate the my Data layer with my business layer it shows the error if i choose AnyCPU/X64 mode. How can i resolve this error.

P.S - I have installed oracle home only.Haven't installed the client version.

Wernfried Domscheit
  • 38,841
  • 5
  • 50
  • 81
Oasis
  • 462
  • 3
  • 16
  • Maybe this answer helps: http://stackoverflow.com/questions/659341/the-provider-is-not-compatible-with-the-version-of-oracle-client#25412992 – Wernfried Domscheit Mar 21 '16 at 07:14
  • You installed Oracle Client 11.2 but your reference to ODP.NET is version 12.1. Perhaps there is a problem. – Wernfried Domscheit Mar 21 '16 at 07:15
  • Thanks Wernfried Domscheit.I will check it out.Is it mandatory to install oracle client version in development machine – Oasis Mar 21 '16 at 07:22
  • Yes, ODP.NET does not run without an Oracle client installation. Some freaks published a list of DLL's to be copied but I really do not recommend this. Consider to use the ODP.NET Managed Driver, this does not require any further installation. – Wernfried Domscheit Mar 21 '16 at 09:10
  • Thanks a lot Wernfried. I have tried by installing both managed/un-manged client installation. But after client installation am getting the nullreference exception when i try to open the connection. When i googled about the error it says it might be due to dll version compatibility issue.Any idea on this? – Oasis Mar 21 '16 at 10:13
  • Did you check all the conditions regarding version and architecture? Did you carefully follow the installation instruction? Maybe uninstall any Oracle client and start from scratch. Check `PATH` environment variable and registry settings. – Wernfried Domscheit Mar 21 '16 at 10:35
  • I have added new managed dll from nuget and that resolved the issue. Thanks Wernfried – Oasis Jun 08 '16 at 08:59

0 Answers0