none
How to edit Console output when debugging! RRS feed

  • Question

  • Hello, I am starting to learn C ++ and C #, my question is when I run the project how do I delete unrelated lines of text. I couldn't think of any keyword to search for this question. I think you guys can help me quickly by what you know.

    This is the text exported by the console

    myresult

    D:\2.0_VSTO_PROJECT\D_1_MY_PROJECT\6 C++\1.Helloworld\Helloworld\Debug\Helloworld.exe (process 14088) exited with code 0. To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops. Press any key to close this window . . .

    In addition, I cannot post photos due to unconfirmed accounts. I opened gmail and found it again but could not find it. What should I do now

    Thanks so much! :)

    Sunday, January 5, 2020 4:52 PM

Answers

  •  when I run the project how do I delete unrelated lines of text. 


    myresult

    D:\2.0_VSTO_PROJECT\D_1_MY_PROJECT\6 C++\1.Helloworld\Helloworld\Debug\Helloworld.exe (process 14088) exited with code 0. To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops. Press any key to close this window . . .


    (1) C++ questions should be posted in the C++ forum.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vcgeneral

    (2) To eliminate those lines on the console, follow the instructions that 
    are in the lines you posted. Note that you will then have to use other 
    means to keep the console window visible when your program ends. These
    include using Ctrl-F5 to run. Or use IDE breakpoints, etc. Other methods 
    in code will be explained in the C++ forum.

    (3) Your account will get confirmed automatically after some activity. The
    delay is just a result of trying to prevent spam. If you're in a hurry you
    can request activation here:

    Forums Issues (not product support)
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=reportabug&filter=alllanguages

    - Wayne

    • Marked as answer by Khanh01 Monday, January 6, 2020 2:58 AM
    Sunday, January 5, 2020 6:55 PM

All replies

  •  when I run the project how do I delete unrelated lines of text. 


    myresult

    D:\2.0_VSTO_PROJECT\D_1_MY_PROJECT\6 C++\1.Helloworld\Helloworld\Debug\Helloworld.exe (process 14088) exited with code 0. To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops. Press any key to close this window . . .


    (1) C++ questions should be posted in the C++ forum.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vcgeneral

    (2) To eliminate those lines on the console, follow the instructions that 
    are in the lines you posted. Note that you will then have to use other 
    means to keep the console window visible when your program ends. These
    include using Ctrl-F5 to run. Or use IDE breakpoints, etc. Other methods 
    in code will be explained in the C++ forum.

    (3) Your account will get confirmed automatically after some activity. The
    delay is just a result of trying to prevent spam. If you're in a hurry you
    can request activation here:

    Forums Issues (not product support)
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=reportabug&filter=alllanguages

    - Wayne

    • Marked as answer by Khanh01 Monday, January 6, 2020 2:58 AM
    Sunday, January 5, 2020 6:55 PM
  • Although the information shown may bother you turning message off in the future you may missing important information e.g. there are times when there are silent error messages that may help assist in figuring out why code is not acting/behaving as expected. I suggest you do not turn these messages off. 

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Sunday, January 5, 2020 7:27 PM
    Moderator
  • Although the information shown may bother you turning message off in the future you may missing important information e.g. there are times when there are silent error messages that may help assist in figuring out why code is not acting/behaving as expected. 

    Karen - 

    The messages shown are *not* error messages from the Output window during
    debugging or building. They are solely the result of a change that was made
    to how the IDE handles the console window when a program ends. Previously
    if you used F5 to run, the console window would close immediately and you
    wouldn't see the output. 

    Using Ctrl-F5 kept/keeps it open but as that is "Run without debugging" it 
    isn't always desirable. The traditional solutions have been to use 
    breakpoints, or stepping, or "Run to cursor" or code solutions such as 
    system("pause"); or _getch(), etc. To facilitate running *with* debugging (F5) 
    without the need for added code, the IDE options were enhanced to provide a 
    new way to keep the console open after the program ends.

    I believe this added option applies to C++ projects only.

    Assuming that the OP is going to use *some* method to ensure that the console 
    window doesn't close immediately before the contents can be read, I see no
    harm or loss of information by reverting to the more traditional methods.
    The "new" messages as a result of this enhancement don't add any *new* 
    error or status messages that wouldn't otherwise be generated, AFAIK.

    On the other hand, one of the motivating reasons for adding this option was
    precisely because beginners were constantly asking the same question: 
    "How do I get the console window to stay open so I can see the output from 
    my program?"

    - Wayne

    Sunday, January 5, 2020 8:21 PM

  • I believe this added option applies to C++ projects only.

    Note that my comment above was using VS 2017 as a reference point.
    The option coverage may have been expanded to apply to C# and/or VB in
    VS 2019. I don't have it installed so can't check that version.

    - Wayne

    Sunday, January 5, 2020 8:33 PM
  • @Wayne, that makes sense.

    I think (and may be it's just me) that novice developers should at least live with these and other messages for a time, everyone is different :-)


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Sunday, January 5, 2020 9:15 PM
    Moderator
  • Great! It was displayed as expected.
    Thanks everyone.
    Monday, January 6, 2020 2:58 AM