locked
program is not debugging RRS feed

  • Question

  • hi all!
    i just installed visual studio on my lap top.
    weird thing happen that i cant debug. i try to debug and all i get is a cmd window that dissapears after a moment and that's it!
    also i'm able to "start without debug" only if i do "build project" each time.
    i.e if i don't do "build project" so the output i'll get will be the same as the previous output.

    seems like the debugger is not linked to the file or something like that because as i told, i have to build and then what i can only do is start without debugging

    idea someone??


    Wednesday, March 19, 2014 2:34 PM

Answers

  • i try to debug and all i get is a cmd window that dissapears after a moment and that's it!

    It is normal for a console application's window to close as soon as the program exits.
    When you Run/Debug that's what naturally happens. When you use "Start without debugging"
    the debugger/IDE will keep the condole window open That's by design.

    There are various ways to keep it open, including (pick one):

    Use "Start Without Debugging" (Ctrl-F5)

    Set a breakpoint in the IDE at the last line of the program.

    Use the "Run to Cursor" menu option to stop executing at a particular line.

    Put a command at the end of the program *before* the final return statement which will
    cause a pause, such as: system("pause"); or getch(); or cin >> ...

    - Wayne

    Wednesday, March 19, 2014 9:00 PM

All replies

  • Is your project set to build a debug version?

    Are you using f10 to start debugging?

    Wednesday, March 19, 2014 6:34 PM
  • i try to debug and all i get is a cmd window that dissapears after a moment and that's it!

    It is normal for a console application's window to close as soon as the program exits.
    When you Run/Debug that's what naturally happens. When you use "Start without debugging"
    the debugger/IDE will keep the condole window open That's by design.

    There are various ways to keep it open, including (pick one):

    Use "Start Without Debugging" (Ctrl-F5)

    Set a breakpoint in the IDE at the last line of the program.

    Use the "Run to Cursor" menu option to stop executing at a particular line.

    Put a command at the end of the program *before* the final return statement which will
    cause a pause, such as: system("pause"); or getch(); or cin >> ...

    - Wayne

    Wednesday, March 19, 2014 9:00 PM
  • i just installed visual studio on my lap top.
    ...
    also i'm able to "start without debug" only if i do "build project" each time.
    i.e if i don't do "build project" so the output i'll get will be the same as the previous output.


    Which version and edition?

    >i'm able to "start without debug" only if i do "build project" each time.
    >i.e if i don't do "build project" so the output i'll get will be the same
    > as the previous output.

    Again, by design. Obviously if you don't do a Build or Rebuild any changes you made won't
    be applied. You can configure the IDE so that it will automatically do a Build when you
    try to Run/Debug if the project is out of date. Exactly how and where you change settings
    usually depends on which version you're running. A typical setting (as found in VC++ 2008):

    Tools->Options->Projects and Solutions->Build and Run: "On Run, when projects are out of date:"

    Always build/Never build/Prompt to build

    See:

    Build and Run, Projects and Solutions, Options Dialog Box
    http://msdn.microsoft.com/en-us/library/cyhcc7zc.aspx

    - Wayne

    Wednesday, March 19, 2014 9:17 PM