I'm trying to use iTextSharp with ASP.NET 5 Core. However I get these errors when I'm trying to build the ASP.NET application with iTextSharp 5.5.5
Code:
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";
}
}
}
Errors:
Error CS0012 The type 'Uri' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. MyProject.ASP.NET 5.0 MyProject/Controllers\GenerateFileController.cs 17
Error CS0012 The type 'Stream' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. MyProject.ASP.NET Core 5.0 MyProject/Controllers\GenerateFileController.cs 17
When I'm trying to do the same thing with ASP.NET 4.6 templates, it works fine. The problem is that I want to use ASP.NET 5 Core for this project. Any Solution?