In a recent project I was faced with this situation.
The dataAccess project (xxx.dataaccess.dll) needed to access the oracle DB for some save operations.
We were using the default .Net Framework dll for Oracle data access (system.Data.OracleClient.dll) and not the ODP.Net one (Oracle.DataAccess.dll).
We found that in a 64 bit machine there was no way to connect to the 64 bit version of the dll and the calls would fail with a [BadImageFormatException.]
To avoid this we had to compile the dataaccess project in 32 bit mode (PlatForm:Active(x86) and Configuration: Active(Release)). This would force the app to connect to the 32 bit version of the dll always.
When the bits were dropped to the web server, following a daily build, we found that during the first access the site was throwing up an error: Unable to find the file or assembly xxx.dataaccess... BadImageFormatException... blah blah...
After much toil I found that in a 64 bit machine, IIS will always run in 64 bit unless specifically instructed to.
The process for enabling it is as follows.
Open IIS Manager>Open Application Pool> Select the app pool used for the site>right click>select "Advanced settings" > Navigate to the field "Enable 32 bit Applications" and select True from the dropdown.
Recycle the app pool or restart the IIS.
The site will be running fine after this..
:)
The dataAccess project (xxx.dataaccess.dll) needed to access the oracle DB for some save operations.
We were using the default .Net Framework dll for Oracle data access (system.Data.OracleClient.dll) and not the ODP.Net one (Oracle.DataAccess.dll).
We found that in a 64 bit machine there was no way to connect to the 64 bit version of the dll and the calls would fail with a [BadImageFormatException.]
To avoid this we had to compile the dataaccess project in 32 bit mode (PlatForm:Active(x86) and Configuration: Active(Release)). This would force the app to connect to the 32 bit version of the dll always.
When the bits were dropped to the web server, following a daily build, we found that during the first access the site was throwing up an error: Unable to find the file or assembly xxx.dataaccess... BadImageFormatException... blah blah...
After much toil I found that in a 64 bit machine, IIS will always run in 64 bit unless specifically instructed to.
The process for enabling it is as follows.
Open IIS Manager>Open Application Pool> Select the app pool used for the site>right click>select "Advanced settings" > Navigate to the field "Enable 32 bit Applications" and select True from the dropdown.
Recycle the app pool or restart the IIS.
The site will be running fine after this..
:)