简体   繁体   中英

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

You have two options to solve

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

在此输入图像描述

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM