7

I am trying to read an xlsx file.

I got exception that

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. c#

then I installed it from here

http://www.microsoft.com/en-us/download/details.aspx?id=13255

then I changed the platform target to x64

now i got this exception:

BadImageFormatException was unhandeled

{"Could not load file or assembly 'LinqToExcel, Version=1.9.0.0, Culture=neutral, PublicKeyToken=9c8ea65a58f03f1f' or one of its dependencies. An attempt was made to load a program with an incorrect format."}

Update 1

I already installed the linq_to_excel using

Install-Package LinqToExcel

and then add the lib files to references

Anastasie Laurent
  • 877
  • 2
  • 14
  • 26

3 Answers3

23

You have two options to solve

  1. Enable IIS to run 32 bits app
  2. Install LinqToExcel_x64
Leistungsabfall
  • 6,368
  • 7
  • 33
  • 41
rsegovia
  • 231
  • 2
  • 3
2

enter image description here

if change 32 bit app in iis From false to true,all conflicts about exteltolinq version solve

Alex Riabov
  • 8,655
  • 5
  • 47
  • 48
0

Please install Microsoft office in your machine it will automatically solve your problem. It worked for me as well.

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 22 '21 at 10:11