I have a 64-bit Windows system and a C # application that uses OleDbConnection to read Excel data through the 32-bit version of AccessDatabaseEngine.exe. Components, since I have Office 32bit installed (as recommended by MSFT) and the 64-bit version of AccessDatabaseEngine will not work with 32-bit Office.
To make my C # application work, I had to install “Prefer 32-bit” in the project build settings. This sets the compiler / platform flag to anycpu32bitpreferred. On Intel platforms, there are no "preferred."
So everything is working fine. On my car. Not on my boss's 64-bit machine, where he installed 64-bit Office.
I can not find any app.config parameter for forced 64-bit. Is there any? Is it theoretically possible in the .NET boot sequence that there can be one?
MSFT did not think about it. I have to somehow create an application that can work with both 32 and 64-bit versions of Office. Can I use OleDbConnection somehow?
I know about the flag CorFlags.exe / 32bitpref-, but this requires support for two versions of the binary file.
Any ideas? Corrections? App.Config options?
source
share