When I check the OLEDB drivers installed using visual studio 2019, it is displaying me that driver is installed and everything works fine and I can make connection to excel file but when I check the drivers installed using PowerShell it doesn't show me on the same machine and this is showing me connection error to excel file. Please assist me to figure out the issue. I'm trying to call an .net dll function which is written using c# and that is reading excel files.
Asked
Active
Viewed 602 times
0

Mohan
- 907
- 5
- 22
- 45
-
3Could be a 'bitness' problem (32 vs 64). Have a look at [this question](https://stackoverflow.com/questions/6649363/microsoft-ace-oledb-12-0-provider-is-not-registered-on-the-local-machine), especially the [second answer](https://stackoverflow.com/a/15032191/9898643) might help you – Theo Apr 19 '21 at 09:27
-
@Theo When I built the assembly in x86, then powershell is not able to load the assembly at all. Exception calling "LoadFile" with "1" argument(s): "Could not load file or assembly 'abc.dll' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)" – Mohan Apr 19 '21 at 11:02
1 Answers
0
With the help of Theo's comment, my issue got resolved once I built all assemblies as x86 in visual studio and then open up 32 bit powershell placed at C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe. Only 32 bit powershell would be able to load 32 bit assemblies. Also 32 bit powershell was displaying that drivers are installed.

Mohan
- 907
- 5
- 22
- 45