Visual Studio Refuses to pause after debugging - c++

Up until now, I have never had a problem with visual studio terminating the program after running. I have been using it for almost two years in c++. I have visual studio 2019. Now, I have to manually write system("pause");
at the bottom of main . It's not that its too much of a hassle, but I am curious if anyone knows why it would mysteriously stop automatically pausing?

Check that the automatically close the console when debugging stops is unchecked.
Tools > Options > Debugging > General > automatically close the console when debugging stops

Related

How can I disable the debug console from showing the file address in my code?

I created a simple program for training purposes in Visual Studio Community Edition 2017 and I'm not having an issue running the program itself but it is showing me the file address for the process its running in the middle of the code in the Debug Console. I'm not sure how to disable this from showing.
I've tried searching Google but honestly I'm not sure how to easily phrase my question so no results really helped.
The program runs perfectly fine with no errors. This is a visual issue
Highlighted area is what I want to get rid of.
You can do it with:
Tools->Options->Debugging->Automatically close the console
Here is a corresponding fragment from the Visual Studio documentation:
Automatically close the console when debugging stops:
Tells Visual Studio to close the console at the end of a debugging session.

Visual Studio 2015 freezes when debugging a cpp code

I've installed Visual Studio 2015 Enterprise. I'm trying to create a c++ OpenGL project, however, it always freezes when I'm debugging(ctrl + f5). I've tried to write a simple program that prints text to the screen and it still freezes. The build completes successfully, projects in C# don't freeze as well. When I'm trying to run the cpp project VS freezes completely and I have to kill the process, running the .exe directly freezes the explorer..
I haven't found any solution to that kind of problem in the web, and I was hoping that someone here will know what to do..
Thanks :)
Try setting a breakpoint on the very first line of your main, click on debug and see if it gets to the breakpoint. If it does, try stepping through until you see what is causing your freeze.
I had exactly the same problem as you. Turns out my Avast anti-virus was causing the issue. I disabled it and now it's working.
I found the answer from this question:
Visual Studio 2015 freezes when finished building

Visual Studio stops breaking on assert()

This started happening today for a Visual Studio 2013 project but I have seen it now and then over the years in other Visual Studio versions.
Running a debug build and for some unknown reason aborts stop raising the message dialog that allows you to break and debug and instead you simple get a message in the output window and the program terminates.
R6010
- abort() has been called
The program '[9408] test_explode.exe' has exited with code 3 (0x3).
Over many years as a C++ developer this gremlin pops up now and then and I always forget how I solve it and can't see what the cause was. I'm sure someone can shed more light on what's happening and the correct fix and at a minimum I'll at least add my own notes.
A manual call to _set_error_mode(_OUT_TO_MSGBOX) somewhere in my program restores the correct behaviour. So it appears the default error mode is being set wrong by some compiler option or Visual Studio setting? I'm just not sure what.
All Debug->Exception settings are enabled.

Keyboard shortcut for debugging the LAST test run in Visual Studio IDE (2013)

I know there are several VS keyboard shortcuts for running unit tests, but the one I really can't find and would like is to be able to run the last executed test in debug mode.
Ctrl+R, L will repeat the last run, but not in debug mode.
If you are debugging a test, and it changes context to the code you are actually running, and then you stop the test, is there a way to start that test in debug mode again using just the keyboard?
I wanted the same thing.
Based on the technique found in the following post
Visual Studio 2012 debug tests keyboard shortcut
I searched for TestExplorer.DebugSelectedTests and assigned a shortcut key to it.
At least in VS2015 (and hopefully in VS 2013) even while debugging changes context to the code you are actually running. The test remains selected in the test explorer window. So, you can run your shortcut key combo and the test will debug again.
Hope this solves the problem for you too.
I know this question was for Visual Studio 2013, but got google go me here.
In Visual Studio 2019 is a shortcut for that Ctrl+R,D:
If you are using ReSharper, you can use Ctrl+U, D to rerun a test in Debug mode.
https://www.jetbrains.com/resharper/features/unit_testing.html

Visual Studio debugger annoyance - Opening hidden/system files

I was just wondering if there is anyway to stop Visual Studio 2008 from showing all of the files like iostream or xiosbase during debugging with a breakpoint?
I'm finding it really annoying and time consuming in having to watch files I would never touch just because I'm printing out to console.
Thanks for looking,
Matt