Tuesday, April 17, 2012

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

Solution: In IIS Set 'Enable 32bit Applications' to True for the application pool used in the site.

If you are using ODP.NET in 64bit machine and have installed ODP.NET 32bit version you may 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'

To resolve the issue:
  • Select application pool that is getting used in the site.
  • Click on Advanced Settings...
  • Enable 32-Bit Applications - True
  • OK
  • You are done!