CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2012
    Posts
    12

    Debugging errors in BackgroundWorker

    Hi!
    I'm using the backgroundworker in an MDI application. The backgroundworker is used in each of the MDI children to analyze some parameters.
    Sometimes there is an error during the analysis, but when the execution stops the debugger highlights Program.Run() instead of the actual line that generated the exception.

    The problem is that the data that is analyzed is downloaded from internet and I don't get the exception regularly.
    How can I debug the exact line that creates the issue?

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Debugging errors in BackgroundWorker

    Put the DoWork code inside a try/catch block and log the error.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured