How to (re)enable breaking on exception in Visual Studio? - visual-studio

While doing pair-programming on an React project with Visual Studio Professional 2017, my partner was working on my machine and disabled some debugger option to see less warnings. I want to undo what he did, but he is not available any more, so that's why I am asking here. I remember faintly that he said something about disabling "some breaking".
I am sure it must be somewhere in the options window which appears after Debug > Options and on that popup somewhere under the entry Debugging. I attached a screenshot of Debugging > General. I already tried the toggling the 3rd check-box, but that did not do the trick.
The interesting thing is that in the sub-window Output I used to see all those exceptions logged, but I do not see them anymore.
References
How to turn off warnings while debugging in VS Code?
Enable a single warning in Visual Studio
How to re-enable breaking on unhandled exception in Visual Studio 2012 Express for Web?

Related

MSBuild compiler warning for javascript debugger statement

There has been more than one occasion where I have mistakenly left a debugger keyword in a javascript file, and rather than finding these (or not) in code reviews, I'd quite like the Visual Studio build process to warn me about this so I remember to remove them - especially in a Release Mode build.
Likewise, maybe some warnings about console.log type of code.
How can I generate an MSBuild warning/error for this?
MSBuild compiler warning for javascript debugger statement
Just like as mentioned in the previously deleted answer, this issue should be more related to the Visual Studio extension rather than MSBuild.
You can use the Visual Studio extensions:
JSLint for Visual Studio
JSHint for Visual Studio
I'm currently using the JSLint from the link above and it works great.
Here are some screen shots of the settings / and my code with an
error. It won't prevent you from checking in, there would likely need
to be a check-in policy on the TFS server, but it will notify you of
the error when you build and save.
Here is the initial page where you can specify how to display the
JSLint validation messages. All of the options across the top you can
set to your liking. You can cancel the build and run the lint process
during save and / or build.
These are all of the specific JSLint rules that you can turn on or
off. I have highlighted the debugger rule that you asked about in your
question.
Certificate: Don't let check in with “debugger” in Visual Studio 2012
Hope this helps.

How do I find which code completion feature is running in Visual Studio?

I use Visual Studio 2017 15.6, with ReSharper 2017.3. They're mostly both ace, but some of their code completion features do the wrong thing more often than they do the right thing. I want to turn them off.
I've managed to turn some off, but can't find which setting is causing some others to run.
Is there some way to find out which specific settings are causing code completion to run? Perhaps some Visual Studio debug log of code completion steps?

Disable Visual Studio Special Debugging Features

I am new to Visual Studio, so I am used to IntelliJ and Eclipse style of functioning. I usually do not use a debugger when I develop, so I do not want to use it in Visual Studio too.
Is it possible to disable all special debugging functionalities which Visual Studio provides when you start your application? I want to have only normal output for the errors. When I disable all debugging, then I do not have usual output too, so this is not an option.
I tried many settings, but nothing seems to work and give me the results I want - no extra popup windows, no shiny layout changes when you have an error, just ordinary output.
Thanks!
Everyone's definition of "normal output" is different. Personally, I like the way Visual Studio handles debugging.
The console window in Visual Studio is a debugger feature and hence that is why it doesn't work when it's not attached to the process. If you want a stack trace without attaching, you could use your language/framework's built-in facilities such as an Exception or StackTrace in the case of .NET. You could also have Windows write a crash dump, but then you are debugging the corpse inside of Visual Studio.

Can I get reverse debugging functionality for Visual Studio 2013 Professional?

I know that GDB comes with reverse debugging, but is there a way I can get this functionality in Visual Studio 2013 Pro?
Visual Studio (2010, 2012, 2013 Ultimate only) does have a feature that allows you to step backwards from a breakpoint or exception (Intellitrace), and the values in the Locals and Autos panes (as well as DataTips that appear on a hover over a statement) will the show the state at that (previous) point. Unfortunately, Intellitrace is not available for 2013 Professional. In addition, it has only limited support for F# and does not support C++ or JavaScript.
Right now, (since no 3rd party extensions exist that I’m aware of) your best option is looking at the call stack to examine the source code that executed prior to the breakpoint or exception. BTW you can “drag” the debug point up and down in the debug gutter of the VS source window but this will only set the point of next execution (any previous state information is not displayed).
Since GDB does have this feature you could try something like VisualGDB or WinGDB, but I'm not sure how well reverse debugging is supported in either of these two or their stability once introduced into the most recent VS IDE.

How to stop "Just In Time Debugging" messages blocking a buildserver

Our buildserver (TeamCity, much recommended), runs our a whole bunch of testsuites on our finished c++ program.
Once in a whole, a test causes our program to crash, often bringing up a VisualStudio dialog offering me to JustInTime debug the crash. The dialog stops the buildserver from progressing. Instead of the build marked as failed, it just hangs. I've turned off the Just In Time debugging feature in VisualStudio, but when it's turned off, you still get a message "Couldn't JustinTime Debug this, you can turn it on in the options".
Does anybody know of a way to ensure that any unhandled exception in a program does not result in any modal dialog?
This MSDN article explains how to disable Just-In-Time debugging on a Windows server. I've included the relevant portion of the article below:
After Visual Studio is installed on a server, the default behavior when an unhandled
exception occurs is to show an Exception dialog that requires user intervention to
either start Just-In-Time debugging or ignore the exception. This may be undesirable for
unattended operation. To configure the server to no longer show a dialog when an
unhandled exception occurs (the default behavior prior to installing Visual Studio), use
the registry editor to delete the following registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\DbgManagedDebugger
On a 64-bit operating system also delete the following registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\DbgManagedDebugger
Delete (or rename) c:\windows\system32\vsjitdebugger.exe.
I tried deleting the registry keys, and I tried unchecking all the boxes in the Visual Studio options, but neither worked.
To be clear, my situation wasn't a C++ one. I was using Micro Focus COBOL for Visual Studio 2010, and by using the registry and VS options suggestions I managed to get rid of the "Want to debug?" dialog, but that resulted in a different dialog to hold up my automated process:
Visual Studio Just-In-Time Debugger
An unhandled exception ('COBOL runtime: Fault detected') occurred in CASDBC.exe [3564]. Just-In-Time debugging
this exception failed with the following error: No installed debugger
has Just-In-Time debugging enabled. In Visual Studio, Just-In-Time
debugging can be enabled from Tools/Options/Debugging/Just-In-Time.
Check the documentation index for 'Just-in-time debugging, errors' for
more information.
OK
I would not recommend to edit/remove regs. Usually the registry is a mess to play with.
The solution that helps me is a quite simple. I`ve just added JIT debugger to my Visual Studio. Steps are:
Open Windows Control panel
Programs
Programs and Features
Find Visual Studio 2017
Click Change. On a new opened window navigate to the Individual Components tab
Check Just-In-Time debugger checkbox
Click modify
After VS reload the error should be fixed.
In my case , on win2012 server, I tried:
removing registry keys
deleting the exe for the jit debugger from c:\windows\system32
and it still came up!
I rebooted, etc.
Was making my web site in IIS stall until dialog was acknowledged!
Final solution, which did work: In control panel, in Programs: Uninstalled "Microsoft Visual Studion 2010 Shell (Isolated)" Uninstalled that, and problem solved.
(Whether SQL Management Studio still works.... I do not know!)
In the Window for the question
Do you want to Debug using the selected debugger?
Click YES (new window opens) > OPTIONS (top row menu) > DEBUG
Then in the New window remove the TICK which shows ENABLE JUST IN TIME DEBUGGER.
After disabling the JUST IN TIME debugger close the window or click OK
Your problem will be solved. I've tried this and got rid of the JUST IN TIME POP UP messages.
Best Solution for this problem is so simple
2 steps to make it done
open cmd prompt
type : regedit
go to path-->HKEY_LOCAL_MACHINE-->SOFTWARE-->Microsoft-->Windows NT-->CurrentVersion-->AeDebug
You can find now the file : Debugger
right click , Modify
copy and paste this text inside it:
drwtsn32 -p %ld -e %ld -g
click ok and voila :)

Resources