none
my C# program will crash when running VS2008 debugger

    General discussion

  • OS: Win 7 x64

    Dev environment: VS2008 sp1, C# and .Net 2.0

    If I run my application in debug it will crash the application (not crashing VS2008 environment) with "AccessViolationException was unhandled". My app runs OK when the debugger is not attached. It only crashes on laptop PC's but is fine on every Desktop I've tried. This has been an ongoing problem for several years and only affects Laptop PC's, earlier with XP and now with Win 7. The crash happens when C# makes a call to a managed C++ dll. Does anyone have an idea where to look?

    Thanks,

    Wednesday, March 28, 2012 6:46 PM

All replies

  • Hi dustyb10,

    Thank you for posting in the MSDN forum.

    We could try to narrow down this issue.

    Whether all C# app will crash when you running VS2008 debugger? For example, just create a simple APP and check it.

    1. If all projects have the same issue, I’m afraid that we should check the VS install, we also need to close the firewall and the Anti-virus software, and make sure that they don’t impact the app. We also need to check our Task Manager, and make sure that it is not very busy.
    2. If just this specific app crashed, you could try to debug this app with “Step Into(F11)”, and check which line code made the App crashed.

    In addition, based on your description, it generates this issue when C# makes a call to a managed C++ dll. I’m afraid that this issue is related to this specific app.

    If a managed DLL is called by native code and you want to debug both, both managed and native debuggers must be enabled. You can set this in the <Project> Property Pages dialog box or window. For more information, see How to: Debug in Mixed Mode. Hope it can help.

    If still no help, could you share us your project? We will try to debug it with our computer.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Friday, March 30, 2012 2:42 AM
    Moderator
  • Thank you for your suggestions. It appears only this one application is affected. This app makes two calls to the managed C++ dll, both will cause it to crash if the debugger is attached. However, when the debugger is not attached, the app's first call to the dll will be successful, only crashing on the second call. It really appears to be a hardware issue. This app runs fine on Dell desktops with XP x32, deployed 3+ years ago, or Win7 x64 on new machines. This app has never run successfully on any Dell laptops of the same vintage and OS.

    Thanks,

    Friday, March 30, 2012 12:43 PM
  • Hi dustyb10,

    Glad to receive your reply.

    This app runs fine on Dell desktops with XP x32, deployed 3+ years ago, or Win7 x64 on new machines. This app has never run successfully on any Dell laptops of the same vintage and OS.

    Based on your description, this app works in other environment and just this specific app has this question, so I afraid that it isn’t the Visual Studio Debugger tool issue. I’m afraid that this issue is related to your VS settings/installing or the system environment.

    My suggestion is that you could check your VS and make sure that the VS installed correctly and make the settings is similar to other setting in VS. If the VS installed well and the settings are similar, as you said, I’m afraid this issue is related to the system environment. 

    Have a nice day,



    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us


    Monday, April 2, 2012 2:33 AM
    Moderator
  • Hi dustyb10,

    Any update? Could you get useful information from my reply?

    Would you mind letting us know the result of the suggestion?

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, April 5, 2012 5:47 AM
    Moderator
  • A few of our developers now have laptop computers on order. When they arrive and we have the development environment installed, we will do further testing. Its difficult to test this issue on end users computers only so we will wait a few weeks. I'll keep you posted on anything we find.

    Thank you,

    Thursday, April 5, 2012 11:56 AM
  • Hi dustyb10,

    Glad to receive your reply.

    Based on our discussion, I’m afraid that it is not the visual Studio Debugger tool issue. We are changing the issue type to General Discussion.

    If you have more time to look at the issue and provide more information, please feel free to change the issue type back to Question by opening the Options list at the top of the post editor window, and changing the type. Thanks for your understanding.

    If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Friday, April 6, 2012 1:58 AM
    Moderator
  • Try to create new project and then try to debug and check whether it crashed or not.

    Monday, April 9, 2012 12:47 PM
  • New projects and debugging them generally work fine. The program I'm having trouble with makes two call to a C++ dll. It runs sucessfully on Windows XPx32 and 7x64 if it is a Dell desktop, with or without debug. On a Dell laptop with either OS, one call to the C++ dll works and the other always fails without debugger running. If I try to debug on the Dell laptop, both calls to the C++ dll will crash the VS debugger. The call to the dll creates the program output file where one option is to create a new file and the other is to add to an existing file. The "new file" method runs OK without debugger. The "add to existing" method always fails on laptop pc's.
    Monday, April 9, 2012 1:20 PM