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

Ana*_*ent 6 .net c# linq-to-excel

我正在尝试读取xlsx文件.

我有例外

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. c#
Run Code Online (Sandbox Code Playgroud)

然后我从这里安装它

http://www.microsoft.com/en-us/download/details.aspx?id=13255
Run Code Online (Sandbox Code Playgroud)

然后我改变了platform targetx64

现在我得到了这个例外:

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."}
Run Code Online (Sandbox Code Playgroud)

更新1

我已经安装了linq_to_excel

Install-Package LinqToExcel
Run Code Online (Sandbox Code Playgroud)

然后将lib文件添加到引用

小智 22

您有两种方法可以解决

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