Error inside Try that does not trigger catch

zequion 446 Reputation points
2024-07-26T02:43:48.8966667+00:00

I have a function that searches for a text in a PDF viewer using the "DevExpress.Xpf.PdfViewer.PdfViewerControl" control. The variable "MyTextSearchParameter" and "ViewerControl" is not null, but the first time I run the function an error always occurs -perhaps because the control is not ready (internal error)- but the catch is not triggered and the image is displayed. How can I make the catch trigger?

imagen

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,008 questions
0 comments No comments
{count} votes

Accepted answer
  1. Olaf Helper 45,096 Reputation points
    2024-07-26T05:18:17.61+00:00

    DevExpress

    That's a 3rd party control, if you have an issue with, contact the software vendor support.

    I make the catch trigger?

    It do, but not in debug mode, when you have switch of the option exception handling, see

    https://learn.microsoft.com/en-us/visualstudio/debugger/managing-exceptions-with-the-debugger?view=vs-2022

    => The debugger is configured to break execution before any handler is invoked.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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