简体   繁体   English

Visual Studio .NETCoreapp v3.1 & iTextSharp

[英]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 CoreiTextSharp 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.

相关问题 无法为“.NETCoreApp,Version=v3.1”解析“Microsoft.EntityFrameworkCore (&gt;= 3.1.7)” - Unable to resolve 'Microsoft.EntityFrameworkCore (>= 3.1.7)' for '.NETCoreApp,Version=v3.1 NU1100:无法解析 'Microsoft.NET.Sdk.Functions (>= 3.0.3)' for '.NETCoreApp,Version=v3.1' - NU1100:Unable to resolve 'Microsoft.NET.Sdk.Functions (>= 3.0.3)' for '.NETCoreApp,Version=v3.1' 迁移到 .Net Core v3.1 后 IAsyncQueryProvider 构建错误 - IAsyncQueryProvider build errors after migrating to .Net Core v3.1 AWSSDK从v2.3更新到v3.1后,文件上载代码无法正常工作 - File upload code not working after AWSSDK update from v2.3 to v3.1 Microsoft反跨站点脚本库v3.1下载 - Microsoft anti-cross site scripting library v3.1 download .NET 5如何构建netcoreapp3.1? - How can netcoreapp3.1 be built by .NET 5? Package X 与 netcoreapp3.1 不兼容 - Package X is not compatible with netcoreapp3.1 从 netcoreapp3.1 升级到 net6.0 时出现 PublishSingleFile 错误 - PublishSingleFile error on upgrading from netcoreapp3.1 to net6.0 为什么Netcoreapp3.1 不兼容.net5.0 Class 库 - Why Netcoreapp3.1 not Compatible with net5.0 Class Library Dot Net Core 3.1 未出现在 Visual Studio 2019 中 - Dot Net Core 3.1 does not show up in Visual Studio 2019
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM