0

I am trying to find the cause of the following error when I run my WPF application on Windows XP.

An unhandled Microsoft .NET Framework exception occurred in MyProgram.EXE [2672] Just-In-Time debugging this exception failed with the following error: No installed debugger has Just-In-Time debugging enabled. In Visual Studio, Just-In-Time debugging can be enabled from Tools/Options/Debugging/Just-In-Time

Check the documentation index for 'Just-in-time debugging, errods' for more information.

I used to have VS2010 running on my XP box but I have uninstalled it.

How do I get more information about what is causing the error?

I am using .Net Framework 4.0 which is installed on the Windows XP machine.

The application runs correctly on Windows 7.

[Update]

The start up object is MyProgram.App

this contains

    public partial class App : Application
{

}

stepping through on the dev machine takes me to

public MainWindow()
        {
           // various controller set up commands
        }

on the dev machine I next step into

MainWindow_Loaded()

however it doesn't make it this far on the XP Machine.

[Update]

I was able to edit the procedure that set up the commands

private void WireupCommands()
        {

            AppDomain currentDomain = AppDomain.CurrentDomain;
            currentDomain.UnhandledException += new UnhandledExceptionEventHandler(MyHandler);

            this.CommandBindings.Add(new CommandBinding(MainCommands.AppExit, MainExitCmdExecuted, AlwaysCanExecute));  // etc
         }

static void MyHandler(object sender, UnhandledExceptionEventArgs args)
        {

            Exception e = (Exception)args.ExceptionObject;
            MessageBox.Show(string.Format("{0} {1}", e.Message, e.StackTrace));
         }

And this reported the error "Image Format Is UnRecognised" along with a stack trace that barely contained a line of my code.

A solution for this is documented here

I still get the Just In Time Debugger message after this

Community
  • 1
  • 1
Kirsten
  • 15,730
  • 41
  • 179
  • 318
  • Can you try a modified version of your app? In that case, try to handle AppDomain.UnhandledException event, and log the exception. – Vikas Gupta Nov 30 '14 at 02:36
  • I have the code, the trouble is figuring out where to put the try-catch. I know from displaying message boxes that the error does not occur in MainWindow() – Kirsten Nov 30 '14 at 02:56

1 Answers1

1

Try hooking up the AppDomain.UnhandledException event during app startup, and use appropriate logging to log the exception. From documentation - "Occurs when an exception is not caught." So you don't have to know where to put the try catch.. Just log it from the event.

Vikas Gupta
  • 4,455
  • 1
  • 20
  • 40