简体   繁体   English

如何在C#中添加ExcelPackage引用

[英]How to add ExcelPackage reference in C#

Please help me: how to add reference for ExcelPackage ? 请帮帮我:如何为ExcelPackage添加参考?

In the following line 在以下行中

using (var excel = new ExcelPackage(FileUpload1.PostedFile.InputStream))

I'm getting this error: 我收到这个错误:

The type or namespace name 'ExcelPackage' could not be found (are you missing a using directive or an assembly reference?) 找不到类型或命名空间名称'ExcelPackage'(您是否缺少using指令或程序集引用?)

I have already called Install-Package DocumentFormat.OpenXml 我已经调用了Install-Package DocumentFormat.OpenXml

为此需要工具添加Install-Package EPPlus -----> Library -----> package console

You can install package from "Package Manager condole" like below: For specific verrsion 您可以从“Package Manager condole”安装软件包,如下所示:对于特定的版本

PM > Install-Package EPPlus -Version 4.5.2.1 

without version 没有版本

PM > Install-Package EPPlus

Generating excel refer blog: http://sforsuresh.in/generating-and-formatting-excelsheet-in-c-using-epplus/ 生成excel参考博客: http//sforsuresh.in/generating-and-formatting-excelsheet-in-c-using-epplus/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM