I have a WPF program that runs fine on the development PC and on the client PC 1. But on client PC 2, it crashes immediately on startup with the Send Report to Microsoft window. I would appreciate some advice on how to trace what is wrong. Here’s what I have tried:
-
Inserted try-catch in my main window class:
public MainWindow() { try { MessageBox.Show("Before InitComp()"); InitializeComponent(); MessageBox.Show("Before Sub1()"); Subroutine1(); MessageBox.Show("Before Sub2()"); Subroutine2(); ... etc ... } catch (Exception ex) { ... code for MessageBox display error here ... } }
The idea is to try to isolate which part of the startup sequence is crashing, but the first debug message “Before InitComp()” does not even show up. So it seems the app is crashing even before starting my code.
- One possibility is to install the entire VS2008 in the client PC 2, load in the source and use the IDE Debugger to trace the problem. This is likely the most effective in finding the problem. But I do not want to do this because a) the client PC 2 does not belong to me, b) it does not scale: I must do likewise for client PC 3/4/5/… and c) it violates my firm’s VS2008 license.
How should I go about debugging this problem?
Old school approach: A hard crash like that is probably bubbling out to something you can see via Event Viewer in Windows. Have you checked there yet? A lot of times this tells me the answer without any extra trouble.