c# - EPPlus 缺少依赖项

标签 c# epplus

我将 EPPlus 和 OfficeOpenXml 的用法添加到我的项目中。 但是,当我运行我的项目时,我收到此错误和警告:

警告:

The referenced assembly "EPPlus" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project.

错误:

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

谁能帮我解决一下?

最佳答案

如警告所述,问题是 EPPlus 引用了一个不在 .NET v4.0 客户端框架中的程序集 (System.Web)。您可能希望针对完整的 .NET v4.0 而不是客户端框架。

更新 这里有关于更改项目目标框架的分步说明:http://msdn.microsoft.com/en-us/library/vstudio/bb398202.aspx在您尝试引用 EPPlus 而不是 .NET 4.0 Client Profile 的项目中,选择 .NET 4.0。

关于c# - EPPlus 缺少依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16907629/

相关文章:

c# - 在 catch 语句之外抛出语句

c# - 有人能告诉我我的 log4net 配置/实现有什么问题吗?

c# - 如何在托管 (C#) 和非托管 (C++) 代码之间来回传递数组内容

c# - EPPlus 不保存对工作表的更改

c# - 使用 EPPlus 在 GDI+ Drawings.AddPicture 中发生一般性错误

c# - 如何使用滚轮缩放

c# - .NET中如何使用反射判断和检查程序集中的类型是Custom类型还是Primitive类型?

c# - 如何将数据附加到现有 Excel 文件?

c# - EPPlus:应用 LoadFromCollection 后如何在每个单元格周围分配边框?

azure - 找不到应用程序依赖项 list 中指定的程序集