0

I'm writing a Windows Forms application using .NET Framework 4, it runs perfectly on Windows 7 and 8, but when I want to show a saveFileDialog in Windows XP the application closes after 3 to 6 seconds of showing the dialog window, I tested the application in two different machines with Windows XP and I get different errors on each one!!, so looking in the Windows event log I can see the message errors:

  • In the first machine the error shown is: "Faulting module clr.dll", so in this case I overwrote the .dll file from another Windows XP but the error persists.

  • In the second machine the error shown is: "The process was terminated due to stack overflow", I'm not using recursion in my application, just showing the dialog.

I'm using a try-catch in this line of code but it doesn't work, the application just closes

So does anybody has a clue about this??, this is the code of my event handler

private void btnExaminar_Click(object sender, EventArgs e)
{
    try
    {
        if (saveFileDialog.ShowDialog() == DialogResult.OK)
        {
            txtExaminar.Text = saveFileDialog.FileName;
        }
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message);                
    }

}    
Tico
  • 65
  • 3
  • 9
  • 1
    For the answer please look [here][1] as windows XP does not support 4.0 [1]: http://stackoverflow.com/questions/4204194/is-net-4-0-compatible-with-windows-xp-sp2-or-below – John Taylor Mar 19 '15 at 21:46
  • OpenFileDialog is "dangerous" in that it allows all the shell extensions to be loaded into your process, necessary to give the dialog the same capabilities as Windows Explorer. A buggy extension can do a fair amount of damage, getting it to crash your app because it is corrupting memory is not terribly unusual. Short from shoving these machines out of a 4th story window, about time, you need SysInternals' AutoRuns utility to diagnose the troublemaker. – Hans Passant Mar 19 '15 at 22:02
  • I am astounded you John Taylor. XP SP2 supports .NET 4.0 just fine. Hans Passant's comment should be turned into an answer as that is surely the problem. – Joshua Mar 20 '15 at 02:42
  • I've never solved this problem. Thankfully it is 2023 now and old machines were changed with newer versions of the OS. Anyways, thanks for your comments. – Tico Jan 03 '23 at 01:47

0 Answers0