小编Gro*_*nis的帖子

无法在ASP.NET 5 Core中使用iTextSharp

我正在尝试将iTextSharp与ASP.NET 5 Core一起使用.但是,当我尝试使用iTextSharp 5.5.5构建ASP.NET应用程序时,我收到了这些错误

码:

using Microsoft.AspNet.Mvc;
using System.IO;
using System;
using iTextSharp;
using iTextSharp.text;
using iTextSharp.text.pdf;

// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860

namespace MyNamespace
{
    public class GenerateFileController : Controller
    {
        // GET: /<controller>/
        public string Index()
        {
            PdfReader reader = new PdfReader("template.pdf");
            return "SomeText";
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

错误:

错误CS0012类型"Uri"在未引用的程序集中定义.您必须添加对程序集'System,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'的引用.MyProject.ASP.NET 5.0 MyProject/Controllers\GenerateFileController.cs 17

错误CS0012类型"Stream"在未引用的程序集中定义.您必须添加对程序集'mscorlib,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'的引用.MyProject.ASP.NET Core 5.0 MyProject/Controllers\GenerateFileController.cs 17

当我尝试使用ASP.NET 4.6模板做同样的事情时,它工作正常.问题是我想在这个项目中使用ASP.NET 5 …

c# asp.net asp.net-mvc itextsharp asp.net-core

5
推荐指数
1
解决办法
4295
查看次数

标签 统计

asp.net ×1

asp.net-core ×1

asp.net-mvc ×1

c# ×1

itextsharp ×1