gpt4 book ai didi

c#-2.0 - EPPlus 找不到类型或命名空间名称 'OfficeOpenXml'(是否缺少 using 指令或程序集引用?)

转载 作者:行者123 更新时间:2023-12-03 06:41:22 61 4
gpt4 key购买 nike

您好,我正在使用 EPPlus 在 C# 2.0 中创建 Excel。我添加了“EPPlus.dll”的引用,还添加了

using OfficeOpenXML;

但是当我尝试运行该解决方案时,它给出了以下错误。

错误:

The type or namespace name 'OfficeOpenXml' could not be found (are you missing a using directive or an assembly reference?)

警告1:

The primary reference "EPPlus, Version=3.1.3.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "EPPlus, Version=3.1.3.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL" or retarget your application to a framework version which contains "WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".

警告2:

The primary reference "EPPlus, Version=3.1.3.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "EPPlus, Version=3.1.3.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".

提前致谢..

最佳答案

这解决了我的问题:

Errors on EPPlus

只需将项目的目标从“.Net 4.0 Client Profile”更改为“.Net 4.0”

关于c#-2.0 - EPPlus 找不到类型或命名空间名称 'OfficeOpenXml'(是否缺少 using 指令或程序集引用?),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19245646/

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