OLEDB connection in VSTO Add-in works on Excel 32 bit but fails on Excel 64 bit


I'm writing a managed Excel VSTO Add-in in C#. In it, I call my assembly PICS which contains all my business logic and has classes that access a FoxPro "database" using the VFPOLEDB driver. This dll works perfectly on my WPF application, other console applications, LINQPad, etc but when my Excel Add-in calls any code that uses the OLEDB access, I get the following error: The 'VFPOLEDB' provider is not registered on the local machine. It is however installed and registered as it is evident by the fact that the same routines work everywhere else. My add-in does work when I run it from Excel 32 bit.

I have looked around but I can't seem to find a solution to this. Some posts suggest I change the build target to x86 which when I try it makes my Add-in fail to load all together: Could not load file or assembly 'PICS.ExcelAddIn, Version=, Culture=neutral' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047);

Any help you can give will be greatly appreciated.

asked on Stack Overflow Nov 9, 2020 by Yosef Bernal

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0