0

In a VB.net 64x project, I used itext7(installed through Nuget) to save PDF files. Everything works fine in debug mode(VS2022, framwork4.8). Then I made a installation package with WixToolset(version4.0). Installation on PC works well as I can see the exe application file with needed dll files in the same C:\program files\ folder. But when run this installed program, an error "unknown PDFException" happens. I believe I distributed all the necessary dlls as shown below. Can anyone help?

iText.Kernel.dll 
iText.Layout.dll 
iText.IO.dll 
iText.Pdfa.dll 
itext.bouncy-castle-connector.dll 
iText.commons.dll 
itext.bouncy-castle-adapter.dll 
itext.bouncy-castle-fips-adapter.dll
3
  • first get all the infoation form the code so add around the code line a try catch , you nee to find the dll thaz is missing good chnaces that they are in the debud/release folder Commented Jan 24 at 19:21
  • I have added all needed dlls. Usually if I missed any, there was a message like some dll is missed, after I added it the error gone. But now the message is "unknown PDFException". Yesterday I had the same error inside VB.net debug mode. After I added bouncy-castle-adapter.dll, it runs well inside VB.net debug without error. But after I used WixToolset to make a installation to distribute, this error came up again. I suspect some dependency is missed, but don't know which one. Commented Jan 24 at 21:01
  • maybe this will help stackoverflow.com/questions/76260218/… Commented Jan 24 at 21:22

1 Answer 1

0

I figured it out adding Microsoft.Extensions.Logging.Abstractions.dll,Microsoft.Extensions.Logging.dll and Microsoft.Extensions.Options.dll solved the problem. I don't know why, but seems iText7 use them for logging or some other purpose. I post here in case someone encounter the similar problem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.