Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1052181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:03:07+00:00 2026-05-16T17:03:07+00:00

We have a WPF application that we’ve deployed to the customer. However, the application

  • 0

We have a WPF application that we’ve deployed to the customer. However, the application is randomly fatally crashing with an “unexpected error” dialog box on the customer’s computer. We need to be able to see the exception message and preferably stack trace as well, but because it’s crashing randomly, we don’t know where we should be putting the try/catch checks so we can log it. We are using NLog for logging. My question is, is there any way for us to either configure NLog to catch all exceptions not handled by our code, or some other method of doing it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:03:07+00:00Added an answer on May 16, 2026 at 5:03 pm

    Why not putting a global try/catch block, covering the whole code?

    Since it is a WPF application, some changes may be required. Instead of letting WPF open the main window automatically, remove App.xaml file, and open the window through code from the application start point (inside try/catch).

    Note that this is not a good practice (like it’s generally bad to catch all exceptions), but may be a temporary workaround to find where the crash occurs.


    Edit: I also invite you to read an answer to a related question about global try/catch blocks in WPF. There is some useful stuff I didn’t know when writing my answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple message box in a WPF application that is launched as
I have a WPF application that runs fine under XP as an administrator. When
I have written a WPF application that I want to port to Silverlight 2.
I have a wpf application that has some shapes on a canvas I want
I have a WPF application that connects via a socket to a device and
We have a WPF Application that has a two flavors with a consistent UI
i have a WPF application that i would like to become the current focused
I have a WPF application that fails to come out of the timed sleep,
I have a WPF application that builds fine, I can even publish it (localhost)
i have a WPF application that sits on top of all other windows. 99%

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.