Could not load file or assembly 'xxx' or one of its dependencies. An attempt was made to load a program with an incorrect format
Sounds like one part of the project is being built for x86-only while the rest is being built for any CPU/x64. This bit me, too. Are you running an x64 (or uh... IA64)?
Check the project properties and make sure everything is being built for "Any CPU". f you're in Visual Studio, you can check for everything by going to the "x86" or "Any CPU" menu (next to the "Debug"/"Release" menu) on the toolbar at the top of the screen and clicking "Configuration Manager..."
Could not load file or assembly ... An attempt was made to load a program with an incorrect format (System.BadImageFormatException)
I am pretty sure you're having a 32-bit / 64-bit conflict. It sounds like your main project might be set to 32-bit while the class its referencing is set to 64-bit. Try looking at this SO question and this one too. Between the two of them, you should be able to figure out your problem.
Could not load file or assembly xxx or one of its dependencies. An attempt was made to load a program with an incorrect format.
It sounds like your Oracle.DataAccess dll is a 64 bit dll. You can see what driver is loaded on the web server by navigating in Windows Explorer to the \windows\assembly folder.
Most applications that are built with the Any CPU option will have the checkbox in the project settings to prefer 32 bit. To avoid this, change your project's platform target to be a 64 bit.
Then you do not need to "Enable 32 bit" in your application pool and your problem should disappear. Please let me know if this helps.
Could not load file or assembly exception
Ok the answer is Got to Start->Run->type inetmgr and on the left application pools, select DefaultAppPool and the virtual directory name of the app and for both make sure to enable 32 -bit applications to true, am using IIS7.0 and windows 7 64-bit.
Related Topics
Unload a Dll Loaded Using Dllimport
Invoking Methods with Optional Parameters Through Reflection
System.Net.Http: Missing from Namespace? (Using .Net 4.5)
Operation Could Destabilize the Runtime
Reference Type Still Needs Pass by Ref
How to Take a Screenshot of a Wpf Control
Iis Server & ASP.NET Core - 500.19 with Error Code 0X8007000D on Httpplatformhandler Tag
3D Relative Angle Sum Calculation
C# Guid and SQL Uniqueidentifier
Processinfo and Redirectstandardoutput
Changing Project Port Number in Visual Studio 2013
Compile and Run Dynamic Code, Without Generating Exe
How to Communicate with a Windows Service
Blocking Dialogs in .Net Webbrowser Control
Specifying Generic Collection Type Param at Runtime
Store a Reference to a Value Type
How to Do a Bulk Insert -- Linq to Entities
A Dependent Property in a Referentialconstraint Is Mapped to a Store-Generated Column