Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load file or assembly 'LinqToExcel, Version

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

like image 258
Anastasie Laurent Avatar asked Aug 10 '14 11:08

Anastasie Laurent


2 Answers

You have two options to solve

  1. Enable IIS to run 32 bits app
  2. Install LinqToExcel_x64
like image 182
rsegovia Avatar answered Nov 18 '22 13:11

rsegovia


enter image description here

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

like image 2
Vahid Vosoughi Avatar answered Nov 18 '22 14:11

Vahid Vosoughi