我正在尝试将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 …