我将 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/