简体   繁体   中英

Visual Studio .NETCoreapp v3.1 & iTextSharp

atm im trying to create a C# Console Application with .NET Core 3.1 installed. Im working with some pdf files and im supposed to use iTextSharp. iTextSharp is only fully compatible with the v3.1. The Problem is somehow even that my project is with .NET Core 3.1 its installing iTextSharp with the .NETFramework Versions 4.6.1 and higher. Most of the functions are working but sadly not all and thats causing the problems for my code.

在此处输入图像描述

I really dont know what im doing wrong and i tried multiple ways to get it to work... like reinstalling VS (2019 latest version), repairing it, install different packages etc etc.

Thanks for any help i can get.

I think that the problem is nuget package iTextSharp itself. And it might be designed by its author.

And from the design of this nuget package, it works for net framework project rather than net core . Not sure it was designed on purpose or forgotten by the author.

Actually , <TargetFramework>net472</TargetFramework> works well but you still want to use Net Core with iTextSharp nuget package, you could try this:

Right-click on your project--> Properties --> Build --> modify the Suppress Warnings with the full name NU1701 .

在此处输入图像描述

The issue is a restore warning rather than an error and it will solve the restore problem. It will not affect the use of the nuget package and cannot cause any other problems.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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