[英]Visual Studio .NETCoreapp v3.1 & iTextSharp
atm im trying to create a C# Console Application with .NET Core 3.1 installed. atm 我正在尝试创建安装了 .NET Core 3.1 的 C# 控制台应用程序。 Im working with some pdf files and im supposed to use iTextSharp.
我正在处理一些 pdf 文件,我应该使用 iTextSharp。 iTextSharp is only fully compatible with the v3.1.
iTextSharp 仅与 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.
问题是我的项目是使用 .NET Core 3.1 安装 iTextSharp 和 .NETFramework 版本 4.6.1 及更高版本。 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.我真的不知道我做错了什么,我尝试了多种方法让它工作......比如重新安装 VS(2019 最新版本),修复它,安装不同的软件包等。
Thanks for any help i can get.感谢我能得到的任何帮助。
I think that the problem is nuget package iTextSharp itself.我认为问题出在 nuget package iTextSharp本身。 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
.从这个 nuget package 的设计来看,它适用于
net framework
项目而不是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:实际上,
<TargetFramework>net472</TargetFramework>
效果很好,但您仍然想将Net Core
与iTextSharp
nuget package 一起使用,您可以试试这个:
Right-click on your project--> Properties --> Build --> modify the Suppress Warnings with the full name NU1701
.右键单击您的项目--> Properties --> Build --> 将Suppress Warnings修改为全名
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.
不会影响nuget package的使用,也不会引起其他问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.