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 6160547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:19:19+00:00 2026-05-23T21:19:19+00:00

I am currently working on a WPF application that processes data in a database

  • 0

I am currently working on a WPF application that processes data in a database and it worked fine when I tested it with a test database with around 1000 rows but now I want to process around 50 000 rows and it just crashes during the processing giving me “‘application’ has encountered a problem and needs to close … Do you want to send error report to Microsoft…”.

Now this may seem like a duplicate of a couple of other questions but I’ve tried AppDomain.CurrentDomain.UnhandledException, AppDomain.CurrentDomain.ProcessExit, Application.DispatcherUnhandledException and it just crashes with no message anyway.

Here’s what it looks like:

private void OnStartup(object sender, StartupEventArgs e)
{
  AppDomain.CurrentDomain.UnhandledException += (s, args) =>
  {
    MessageBox.Show("Message1");
  };

  AppDomain.CurrentDomain.ProcessExit += (s, args) =>
  {
    MessageBox.Show("Message2");
  };

  this.DispatcherUnhandledException += (s, args) =>
  {
    MessageBox.Show("Message3");
  };

  try
  {
    Views.MainView view = new Views.MainView();
    view.DataContext = new ViewModels.MainViewModel();
    view.ShowDialog();
  }
  catch (Exception exception)
  {
    MessageBox.Show(exception.ToString());
  }
}

The processing is started by a command (a GUI button with command binding to call this):

public void Process()
{
  Thread workerThread = new Thread(new ThreadStart(DoProcess));
  workerThread.IsBackground = true;
  workerThread.Start();
}

private void DoProcess()
{
  try
  {
    // Most probably crashes during that
    DoStuff();
  }
  catch (Exception e)
  {
    System.Windows.MessageBox.Show(e.ToString());
  }
}

I checked the memory usage during execution and it never goes above 70 meg, so that shouldn’t be a problem. I use 2 COM components, one that is an .exe and another that is a .dll, I don’t know if problems can come from that. Note that sometimes those components crash and I do receive a useful error message when it happens. I work with NHibernate to read/write from the database.

For now I have absolutely no clue what the problem is (the DoStuff() part is quite big), and I don’t understand how an error can get past all those exception handlers and just crash the application without information. Note that I can’t debug the application in Visual Studio because I run the application on a VM that doesn’t have Visual Studio installed (and I’ve been waiting for 2 months to get my IT department to install me sql server so that I can run my application on my computer).

Any help would be appreciated!

  • 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-23T21:19:21+00:00Added an answer on May 23, 2026 at 9:19 pm

    Your DoProcess function is in a background thread. Another thread may be crashing, or you might have an issue calling MessageBox from a background thread because it’s not the UI thread — so you may be getting an exception, and then a new exception is thrown from your catch because of the MessageBox call. Try inserting code to write the message to a file before the MessageBox call and see if that works, or even a Console.Beep() for that matter and listen for it 🙂 If that uncovers nothing, try adding log statements to files at many places in your code until you narrow down where the crash occurs.

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

Sidebar

Related Questions

I am working on an WPF application that uses a BusinessLogic layer (currently a
I'm currently working on an application that will generate actual .cs and .xaml code
I am currently working on a WPF application where I would like to have
We are currently working on porting an old VB6 application to WPF. The plan,
I am currently working on an Paint-like WPF application and now stand before the
I'm currently working out the layout of a WPF Application and seem to have
I'm currently working on my first WPF application, and I'm curious as to whether
I am currently working on a project of mine which is a MSPaint-like WPF
I'm working with a Win32 application that needs to create a variety of custom
I am currently working on a very large legacy MFC MDI application. It has

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.