Share via

Error to "dotnet add package Xam.iTextSharpLGPL"

Jonathan 170 Reputation points
2026-06-06T15:29:03.71+00:00

Hi,

Can you help to the errors when running "dotnet add package Xam.iTextSharpLGPL"?

User's image

Developer technologies | ASP.NET Core | Other

3 answers

Sort by: Most helpful
  1. Danny Nguyen (WICLOUD CORPORATION) 7,105 Reputation points Microsoft External Staff Moderator
    2026-06-08T04:27:13.0166667+00:00

    Hi @Jonathan ,

    The error is happening because Xam.iTextSharpLGPL 0.1.0 is an old Xamarin package and it does not appear to support your current target frameworks, such as net10.0-ios, net10.0-maccatalyst, and net10.0-windows.

    Bruce's answer is correct. This package is based on an older iTextSharp version, so this is not just a dotnet add package command issue — the package itself is not compatible with the target frameworks being used.

    If you still want to use an older LGPL-based iTextSharp option, you may need to look for a package that supports modern .NET targets, such as iTextSharp.LGPLv2.Core. However, please review the package license and compatibility to make sure it fits your project.

    If you need newer official iText features, please also review the official iText AGPL/commercial licensing terms before using it in your application.

    If you found my response helpful or informative, I would greatly appreciate it if you could follow this guidance or provide feedback.

    Thank you.

    Was this answer helpful?


  2. Bruce (SqlWork.com) 84,086 Reputation points
    2026-06-07T16:07:03.5633333+00:00

    The licensing requirements of itext changed with version 5 from gpl to agpl. To use the free version your project must also be open source (you must publish your source code) otherwise you need to buy the commercial version.

    https://itextpdf.com/how-buy

    The license change led to many of open the source projects that wrap itext to abandoned. The library you are trying to use was abandoned over 10 years ago.

    There is an active port of the of the old project which used the v4 source which has a more open license:

    https://www.nuget.org/packages/iTextSharp.LGPLv2.Core

    Was this answer helpful?


  3. AI answer

    2026-06-06T15:29:18.4333333+00:00

    The errors occur because Xam.iTextSharpLGPL targets only old Xamarin/Mono frameworks and is not compatible with the target framework of the project (net10.0-* in the screenshot). NuGet therefore reports NU1202 “package is not compatible with…” and refuses to add it.

    To resolve this, use one of these approaches:

    1. Use a compatible target framework
      • Create or retarget a project to one of the frameworks the package supports (for example monoandroid10, monotouch10, xamarinios10, or older net4x if listed in the package metadata) and reference the package only from that project.
      • This is only practical if specifically building an old Xamarin app; it is not suitable for modern .NET (such as .NET 6/7/8/10).
    2. Replace the package with a modern alternative
      • For .NET (including .NET for Android/iOS/MacCatalyst), choose a PDF library that explicitly supports the project’s target framework. Install that package instead of Xam.iTextSharpLGPL.
    3. Avoid forcing the install
      • Do not try to bypass the compatibility check; the package binaries will not run correctly on net10.0-* because there is no matching runtime pack.

    In summary, either change the project to an older, supported framework or, preferably, use a different PDF library that supports the current .NET target.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.