Exception: An attempt was made to load a program with an incorrect format. w/ Oracle.DataAccess.dll

I am getting the following exception in the debugger for my Windows Console application:
Exception Message: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
Exception Source: Oracle.DataAccess
Exception StackTrace:    at Oracle.DataAccess.Client.OpsTrace.GetRegTraceInfo(UInt32& TrcLevel)
   at Oracle.DataAccess.Client.OraTrace.GetRegistryTraceInfo()
   at Oracle.DataAccess.Client.OracleConnection..ctor(String connectionString)
   at DPDGeocodeToSDETable.Program.Main(String[] args) in C:\Documents and Settings\dunhamm\My Documents\Visual Studio 2005\Projects\DPDGeocodeToSDETable\DPDGeocodeToSDETable\Program.cs:line 30

I have compiled web apps with this same dll in the same VS 2005 environment on the same machine and did not see this error.

The OS is Windows 2003 Server 64-bit running 32-bit IIS.  VS 2005 is installed as x86.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Th eexact error description is

# for hex 0x8007000b / decimal -2147024885 :
  COR_E_BADIMAGEFORMAT                                          corerror.h
# MessageText:
# The format of DLL or executable being loaded is invalid.

Maybe the binary image simply is corrupted?
MicheleDunhamAuthor Commented:
I tried copying the Oracle dll from another server that I know works and it didn't fix the problem.
Thanks for the suggestion.
Try the dependency walker (www.dependencywalker.com) to see whether the error code is misleading, i.e. a depending DLL could not be found.
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

MicheleDunhamAuthor Commented:
I just recompiled a web app on the same machine that makes the exact same call to the dll and it works.  Could there be something this is different in the execution of the console app versus the web app?  Would the dependency walker show this? Not knowing how this works exactly do I download the x86 version?
MicheleDunhamAuthor Commented:
Okay, I have some results from DependencyWalker but I'm not sure what they mean...here is a screen shot.
Um, can you use an image file format? I am not too keen to download Word documents :-(
MicheleDunhamAuthor Commented:
Here is a jpg...
Ah, OK, the ones listed as "the system cannot find..." are missing and probably the reason for the error.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MicheleDunhamAuthor Commented:
MicheleDunhamAuthor Commented:
After reading the above link, I'm not sure what to do next?
MicheleDunhamAuthor Commented:
After today, I won't be back in the office until Tues. morning.  I'll check back then.
MicheleDunhamAuthor Commented:
Found this...user483831 is getting exact same error, although I'm compiling with an earlier client  Perhaps I will have to use another interface such as Microsoft's Oracle library.

MicheleDunhamAuthor Commented:
Thank you for helping to determine the root cause of the problem which is the Oracle Data Provider ODP.NET.  I believe at this point it will be necessary to use some other means of connecting to our Oracle database for Windows Console applications that we create with .NET 2.0 and compile in the Windows 64-bit / IIS 32 bit environment.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.