gpt4 book ai didi

.net - ClosedXML - 无法加载文件或程序集

转载 作者:行者123 更新时间:2023-12-04 11:49:34 46 4
gpt4 key购买 nike

我正在尝试使用 ClosedXML 在应用程序中生成 excel 文档,但是当我尝试运行它时,我收到无法加载文件或程序集服务器错误。

Could not load file or assembly 'DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

我已经看到了几种解决方案,包括在其属性中更改 .dll 的“复制本地”值并将程序集直接添加到 web.config。

我使用的是 Visual Studios 2010,并且 dll 属性不包含“复制本地”条目。然后当我在 web 配置中输入以下程序集时,我仍然收到相同的服务器错误消息。我从提供的错误消息中获得了程序集。
 <add assembly="ClosedXML, Version=0.76.0.0, Culture=neutral, PublicKeyToken=fd1eb21b62ae805b"/>

最佳答案

在疯狂寻找答案并最终发布问题之后,我遇到了最简单的答案,一旦我引用了额外的 .dll,一切都正常。

要使用 ClosedXML,您必须引用 DocumentFormat.OpenXml.dll:

NET 4.0+ 的 DocumentFormat.OpenXml.dll

关于.net - ClosedXML - 无法加载文件或程序集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34907898/

46 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com