Search code examples
c#exceptiontry-catchpdfsharp

C# PDFsharp. How to skip past errors?


I am converting and merging 750k pages into 1/2 million multi-page PDFs in a WinForm program.

I have my PDF write function inside a try catch block but PDFSharp keeps throwing up assertion failures with a dialogue box.
If I hit an error I just want the program to log the exception details and go to the next set of files because I won't be awake in the middle of the night to press Ignore.

How could I stop this in C# please? Setting to release instead of debug doesn't work.


Solution

  • Assertions are no exception.

    Assertions only show with the DEBUG build, not the RELEASE build. So use the RELEASE build properly and no assertions will show up. Maybe try the latest NuGet packages.