Could not load file or assembly 'LinqToExcel, Version

Anastasie Laurent picture Anastasie Laurent · Aug 10, 2014 · Viewed 10.7k times · Source

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

Answer

rsegovia picture rsegovia · Aug 28, 2015

You have two options to solve

  1. Enable IIS to run 32 bits app
  2. Install LinqToExcel_x64