Could not load file or assembly Oracle.DataAccess Error

Assigned with the task of updating a .NET application to use the most recent framework (4.0) and Oracle driver (ODP.NET) I was confronted with the following error at runtime:

Could not load file or assembly Oracle.DataAccess Error

After reading Mark Williams answer on this thread, the solution was to simply to check what scenario my development machine fitted on:

  1. 32-bit ODP.NET installed on 64-bit o/s
  2. .NET application compiled with either “Any CPU” or “x64″ set for the “Platform target”
  3. The application is then deployed to the 64-bit host with the 32-bit ODP.NET installed
  4. The application executes as a 64-bit application but tries to load the 32-bit ODP.NET, thus the exception

My scenario was none of the above, but an additional one:

  • 64-bit ODP.NET with the “Any CPU” set for the “Platform target”.

As soon as I selected “x64″ for the platform target, all performed successfully:

HTH you all.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s