我正在尝试使用spreadsheetlight来写入excel文件,但是显然spreadsheetlight使用的是XML2.0,而我已经安装了2.5。我已经卸载了2.5版本,并将2.0引用添加到我的项目中,但我仍然收到一条错误消息,告诉我我正在使用2.5版本。我的问题很简单:如何获得编译器(?)使用2.0版本而不是2.5版本?
诚挚的Axel
发布于 2015-08-12 23:40:21
因此,问题似乎是Spreadsheetlight nuget包在Nuspec中缺少所需的依赖规范。
安装-Package DocumentFormat.OpenXml -Version 1.0.0
如果您已经安装了DocumentFormat.OpenXml,并且遇到类似于Could not load type ‘DocumentFormat.OpenXml.Spreadsheet.SmartTags’ from assembly ‘DocumentFormat.OpenXml, Version=2.5.5631.0的异常
卸载-软件包DocumentFormat.OpenXml
如果有程序集绑定重定向,请检查配置文件
<dependentAssembly>
<assemblyIdentity name="DocumentFormat.OpenXml" publicKeyToken="31bf3856ad364e35"... />
<bindingRedirect oldVersion="0.0.0.0-2.5.5631.0" newVersion="2.5.5631.0" />
</dependentAssembly>删除这个。
现在安装特定版本:
安装-Package DocumentFormat.OpenXml -Version 1.0.0
https://stackoverflow.com/questions/22911048
复制相似问题