【问题标题】:Could not load file or assembly 'LinqToExcel, Version无法加载文件或程序集'LinqToExcel,版本
【发布时间】:2014-08-10 11:45:11
【问题描述】:

我正在尝试读取 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 文件添加到引用中

【问题讨论】:

  • 请问答案在哪里?我没有保存链接
  • 您安装了哪个版本的 Microsoft Access 数据库引擎?如果你安装的是 x64,我会尝试卸载它并安装 32 位版本。
  • 看起来像个骗子……stackoverflow.com/questions/22954762/…
  • @Mick 是的,使用 32 他治愈了

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


【解决方案1】:

你有两个选择来解决

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

【讨论】:

  • 我从字面上搜索了错误消息。来到这个问答环节。执行了你的第一选择。问题消失了。谢谢!
【解决方案2】:

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

【讨论】:

    【解决方案3】:

    请在您的机器上安装 Microsoft Office,它会自动解决您的问题。它也对我有用。

    【讨论】:

    • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
    猜你喜欢
    • 1970-01-01
    • 2017-10-15
    • 2020-05-09
    • 2018-10-04
    • 2020-11-11
    • 2013-11-14
    • 2020-04-02
    • 2017-10-18
    • 2011-09-04
    相关资源
    最近更新 更多