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.
MicheleDunhamAsked:
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.

jkrCommented:
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?
0
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.
0
jkrCommented:
Try the dependency walker (www.dependencywalker.com) to see whether the error code is misleading, i.e. a depending DLL could not be found.
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

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?
0
MicheleDunhamAuthor Commented:
Okay, I have some results from DependencyWalker but I'm not sure what they mean...here is a screen shot.
screenshot.doc
0
jkrCommented:
Um, can you use an image file format? I am not too keen to download Word documents :-(
0
MicheleDunhamAuthor Commented:
Here is a jpg...
screenshot.jpg
0
jkrCommented:
Ah, OK, the ones listed as "the system cannot find..." are missing and probably the reason for the error.
1

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:
0
MicheleDunhamAuthor Commented:
After reading the above link, I'm not sure what to do next?
0
MicheleDunhamAuthor Commented:
After today, I won't be back in the office until Tues. morning.  I'll check back then.
0
MicheleDunhamAuthor Commented:
Found this...user483831 is getting exact same error, although I'm compiling with an earlier client 9.2.0.7.0.  Perhaps I will have to use another interface such as Microsoft's Oracle library.
http://forums.oracle.com/forums/thread.jspa?threadID=340693 

0
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.
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.