locked
C# VS 2008 Executable crashes on non-development machines RRS feed

  • Question

  • I have been using VS2005 and VS 2008, NET 2.0, for some time now to write programs for XP, Vista and WIN7 32/64.

    Usually I have no problems, but just recently I created an executable that ONLY runs on the development machine. Whenever I try to run the pogram on any other machine, it crashes - before any of my application messages show up.

    I am at a loss. I do not know how to trace and debug a standalone executable.

    The crash occurs on XP Home, XP Professional, XP, Vista and Win7-32/64.

    • Moved by Harry Zhu Friday, June 18, 2010 6:47 AM (From:Visual C# Express Edition)
    Friday, June 11, 2010 4:37 PM

Answers

  • I am at a loss. I do not know how to trace and debug a standalone executable.

    The crash occurs on XP Home, XP Professional, XP, Vista and Win7-32/64.


    To Trace and Debug an executable, you need classes in System.Diagnostics namespace. There are many classes providing a set of methods and properties that help debug your code. For example, you could use a code snippet as below to check the parameters of a method:

    private static int Divide(int pFirst, int pSecond)
    {
        Debug.Assert(pSecond != 0, "pSecond == 0");
        
        // other stuff.
        // ....
    }

    Besides, there is a Trace class and EventLog class which allow you to make a log file when debugging. Please take a look at this KB article for more information on Trace and Debug in C# applications:
    http://support.microsoft.com/kb/815788/en-us

    Best regards


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    • Marked as answer by mediadogg Monday, June 21, 2010 2:41 PM
    Friday, June 18, 2010 7:16 AM

All replies

  • Hi,

    What exactly information you are getting in Error when it crash? Have you used any third party dll in your project? Can you pelase share more details about your problem.


    Regards
    Nayan Paregi (MCTS)
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Friday, June 11, 2010 5:12 PM
  • Thanks for your reply. Yes, but the dll is also used by other applications and has been working for a long time.

    Here is the system info:  (How do I send you the .mdmp file?)

    <?xml version="1.0" encoding="UTF-16"?>
    <WERReportMetadata>
     <OSVersionInformation>
      <WindowsNTVersion>6.1</WindowsNTVersion>
      <Build>7600 </Build>
      <Product>(0x3): Windows 7 Home Premium</Product>
      <Edition>HomePremium</Edition>
      <BuildString>7600.16539.amd64fre.win7_gdr.100226-1909</BuildString>
      <Revision>1</Revision>
      <Flavor>Multiprocessor Free</Flavor>
      <Architecture>X64</Architecture>
      <LCID>1033</LCID>
     </OSVersionInformation>
     <ParentProcessInformation>
      <ParentProcessId>3696</ParentProcessId>
      <ParentProcessPath>C:\Windows\explorer.exe</ParentProcessPath>
      <ParentProcessCmdLine>C:\Windows\Explorer.EXE</ParentProcessCmdLine>
     </ParentProcessInformation>
     <ProblemSignatures>
      <EventType>APPCRASH</EventType>
      <Parameter0>dvdProDash.exe</Parameter0>
      <Parameter1>0.0.0.0</Parameter1>
      <Parameter2>4c1137bb</Parameter2>
      <Parameter3>KERNELBASE.dll</Parameter3>
      <Parameter4>6.1.7600.16385</Parameter4>
      <Parameter5>4a5bdfe0</Parameter5>
      <Parameter6>e0434f4d</Parameter6>
      <Parameter7>000000000000aa7d</Parameter7>
     </ProblemSignatures>
     <DynamicSignatures>
      <Parameter1>6.1.7600.2.0.0.768.3</Parameter1>
      <Parameter2>1033</Parameter2>
     </DynamicSignatures>
     <SystemInformation>
      <MID>24344505-ED64-4A4F-931A-17CA2201C340</MID>
      <MarkerFile>1025_ACER_AX1700-X64</MarkerFile>
      <SystemManufacturer>Acer</SystemManufacturer>
      <SystemProductName>Aspire X1700</SystemProductName>
      <BIOSVersion>R01-B1</BIOSVersion>
     </SystemInformation>
    </WERReportMetadata>

    Friday, June 11, 2010 7:52 PM
  • Hi,

    Sorry for the late reply. The question relating to debug is beyond the scope of this foum, I suggest you try debug forum for better support:
    http://social.msdn.microsoft.com/Forums/en/vsdebug/threads

    Thanks,
    Harry


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, June 18, 2010 6:47 AM
  • I am at a loss. I do not know how to trace and debug a standalone executable.

    The crash occurs on XP Home, XP Professional, XP, Vista and Win7-32/64.


    To Trace and Debug an executable, you need classes in System.Diagnostics namespace. There are many classes providing a set of methods and properties that help debug your code. For example, you could use a code snippet as below to check the parameters of a method:

    private static int Divide(int pFirst, int pSecond)
    {
        Debug.Assert(pSecond != 0, "pSecond == 0");
        
        // other stuff.
        // ....
    }

    Besides, there is a Trace class and EventLog class which allow you to make a log file when debugging. Please take a look at this KB article for more information on Trace and Debug in C# applications:
    http://support.microsoft.com/kb/815788/en-us

    Best regards


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    • Marked as answer by mediadogg Monday, June 21, 2010 2:41 PM
    Friday, June 18, 2010 7:16 AM
  • Ok, thanks. Now I have something to chew on and some hope ...
    Friday, June 18, 2010 6:41 PM