• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2730
  • Last Modified:

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.
0
MicheleDunham
Asked:
MicheleDunham
  • 9
  • 4
1 Solution
 
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
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 9
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now