Search code examples
unity-game-enginepdfuwpitextitext7

NotSupportedException on UWP Unity build with iText7


I am developing an app for Universal Windows Platform in Unity and I am using iText 7.1.14 to generate a PDF from script. On editor it works fine and gets to export my .pdf file. I don't get any error during the building process. However, I am getting the following exception from a development UWP build:

NotSupportedException: System.Configuration.ConfigurationManager::GetSection

Here the complete console log

I did several builds by changing the SDK and ScriptingBackend plugin import settings, but it's still not working. Also, I switched between targeting .NET 4.x and .NET Standard 2.0 APIs without sucess.

I have been researching about the iText library support for UWP but I haven't found clear information about it. At this point, I am not sure if iText 7.1.14 plugins support UWP builds. Some ideas?

Just to be clear, I'd prefer to discard the possibility of using iText before looking for alternative free/paid solutions like Syncfusion, XFinium or so.

Thank you so much!


Solution

  • SOLVED

    After several tries, the project has built by doing the following steps:

    • Removed all the iText7 content of Plugins folder.

    • Reimported iText7 with all its .dll dependencies.

    • For each library, I have kept one .dll for .NET 4.x and another one for .NET Standard 2.0.

    • I have configured the Import settings to make the .NET Standard 2.0 ones work only on the build (excluding Editor)

    Then, it have worked on a UWP build with API Compatibility Level .NET Standard 2.0.