Answered by:
An attempt was made to load a program with an incorrect format

Question
-
User-1078520054 posted
I have a WCF app working all great on my local PC. No issues.
However: when I upload the contents to our test server, I am getting the following error:
An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
I believe this is in reference to our Oracle.DataAccess.dll file, but I can't figure out what to do. We have another web application on the same server running the same .dll with no issues.
What is confusing me even more though is:
Oracle.DataAccess on my computer is 1,400 KB
Oracle.DataAccess on the server is 1,396 KB
I am not sure where this file on the server came from, as we didn't install ODP.Net on the server, just using the Oracle.DataAcess.dll located in the projects /bin folder.
But if I use the mysterious file on the server: I get the following error:
An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
If I push up the Oracle.DataAccess that is local to my computer to the server, the error is:
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.
I am not sure why I can't get this running on the server, but also why different error messages.
Any help is greatly appreciatedWednesday, August 7, 2013 4:40 PM
Answers
-
User220959680 posted
ok.
Go throught the solution at http://forums.asp.net/t/1647562.aspx/2/10
and let us know further.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, August 8, 2013 9:01 AM
All replies
-
User1051163829 posted
Hi,
Have you tried regsvr32 /u on the dlls in all locations you cna find on the server? Perhaps there's one in the GAC or perhaps an older app has one registered - I think that might produce similar symptoms?
run cmd as administrator and "regsvr32 /u <path>\Oracle.DataAccess.dll" and try again?
HTH's
Wednesday, August 7, 2013 4:57 PM -
User-1078520054 posted
I haven't ran REGSVR32 on my local / development machine because we ran the ODP.Net installation on them, which I assume should have done what ever was needed to register the files.
On the server: I am not sure as I am not the administrator for it, but why would the same Oracle.DataAccess.dll file work in the Web application, but not in the WCF application? If it was a registered issue, I would expect similar results for both applications on that server.
Wednesday, August 7, 2013 5:01 PM -
User220959680 posted
When 32-bit applications run on IIS 7 (and/or 64-bit OS machine), same exception is thrown.
From the IIS 7, right click on the applications' application pool and go to "advanced settings" and change "Enable 32-Bit Applications" to "TRUE".
Let us know the out come.
Thursday, August 8, 2013 4:59 AM -
User-1078520054 posted
Thank you so much for the help, it is greatly appreciated.
Unfortunately though, that didn't solve the issue. I get the following:
The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<!DOCTYPE html>
<html>
<head>
<title>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.</title>
<meta name="viewport" content="width=device-width" />
<style>
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Consolas","Lucida Console",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underli'.When I set it back to false: I get the following:
An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) Thursday, August 8, 2013 7:18 AM -
User220959680 posted
ok.
Go throught the solution at http://forums.asp.net/t/1647562.aspx/2/10
and let us know further.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, August 8, 2013 9:01 AM -
User-1078520054 posted
Thank you so much for the help. We found the solution in the link you posted. Specifically it was step #2, to install ODP.Net on the server and then set the Application pool to 32-Bit. Greatly appreciate all your help.
Thursday, August 8, 2013 10:23 AM