我正在尝试使用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.config 中输入以下程序集时,我仍然会收到相同的服务器错误消息。我从提供的错误消息中获得了该程序集。
<add assembly="ClosedXML, Version=0.76.0.0, Culture=neutral, PublicKeyToken=fd1eb21b62ae805b"/>