Errors on Itext7 using VB and .NET after installing itext7.bouncy-castle-adapter

42 views Asked by At

I’m trying to run a very simple Itext7 test program using VB in .NET. In NuGet Manager Console I used “Install-Package itext” to install itext.8.0.2, then to fix errors installed itext7.bouncy-castle-adapter. I now get 2 errors on this line in the code

Dim writer As New PdfWriter(outputPdfPath)

They are: TypeInitializationException: The type initializer for 'iText.Bouncycastleconnector.BouncyCastleFactoryCreator' threw an exception.

And: TypeLoadException: Method 'GetDigestAlgorithmOid' in type 'iText.Bouncycastleconnector.BouncyCastleDefaultFactory' from assembly 'itext.bouncy-castle-connector, Version=8.0.2.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca' does not have an implementation.

Restarting VB did not fix it.

1

There are 1 answers

0
Steve Jack On

Upgrading the packages fixed it: itext.8.0.2 -> itext.8.0.3 BouncyCastle.Cryptography.2.2.1 -> BouncyCastle.Cryptography.2.3.0