BadImageFormatException or Architecture Mismatch message when using ODBC connection
Environment
| Product | Progress® Telerik® Report Server |
| Operating System | Windows |
| Target Framework | .NET Framework 4.6 |
Description
When the Report Server application is running in 32-bit application pool and opens an ODBC connection that uses a 64-bit driver, the ODBC Driver Manager throws either a BadImageFormatException(reproduced with Oracle driver) or shows an The specified DSN contains an architecture mismatch between the driver and the application error message (reproduced with Progress® OpenEdge® driver).
The same is valid also if the Report Server is running in 64-bit application pool and ODBC uses a 32-bit driver.
Solution
If the correct version of database drivers is installed, then the Report Server's application pool should be set to run in different mode (32 or 64-bit).
The Report Server's application pool settings define it as a 64-bit application by default. To change it:
- Navigate to the Report Server's application pool in the IIS Manager
- Open its Advanced Settings form and look for a Enable 32-bit Applications property
- Change it to False to run the Report Server instance in 64-bit mode and recycle the pool.