无法加载文件或程序集'LinqToExcel,Version

时间:2014-08-10 11:45:12

标签: c# .net linq-to-excel

我正在尝试阅读xlsx文件。

我有例外

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

然后我从这里安装了

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

然后我将platform target更改为x64

现在我遇到了这个例外:

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."}

更新1

我已经安装了linq_to_excel 使用

Install-Package LinqToExcel

然后将lib文件添加到引用

2 个答案:

答案 0 :(得分:22)

您有两种方法可以解决

  1. 启用IIS以运行32位应用
  2. 安装LinqToExcel_x64

答案 1 :(得分:1)

enter image description here

如果将iis中的32位应用程序从false更改为true,则有关exteltolinq版本的所有冲突都将解决

相关问题