So my program crashed in a demo and I want to know where it crashed. I was wondering if visual studio saves that somewhere.
If you have the Visual Studio debugger attached, during the debug session it can stop on any uncaught exceptions. There's also the IntelliTrace window in the higher SKUs of VS that will show a log of any tracing activity, including when exceptions were thrown and caught.
If the debugger wasn't attached (or VS wasn't running), then there's nothing AFAIK to keep a record. However most app crashes will get logged to the Windows Event Log, and usually include a stack trace. Launch the Event Viewer, and look under Windows Logs -> Application.
Not automatically, unless you have your own logging enabled (such as log4net). If you're lucky you may find something in the Windows Event Log. But Visual Studio - nope.
Related
Okay so it appears in the last week or so my Enterprise Visual Studio 2017 can no longer get the 'Events' to populate at all for the Diagnostics tool. The tool shows up and runs just fine, it however does not have any events even as I can see and when clicking the filter. Except funny enough it can load symbols and still hit breakpoints and even tell me: "Yep I got your breakpoint event". The problem being I used it a lot for ADO.NET and data tracking to double click an item and get the 'historical debugging'. Basically the 'Filter' says I don't have events yet and even if it hits a breakpoint it only acknowledges the one event.
Things I have tried:
Deleting the SUO files for the solution I am on.
Checking the Debug General Options against another Dev whose is working. And ensuring 'Enable Just My Code' is on.
Changed Configuration settings from Debug to Release and changing CPU configs to see on the off chance this could be it.
Shut down the PC and rebooted.
I tried suggestions on this thread:
Visual Studio 2015 diagnostic tools no longer working
In your screen shot, it just has the break events, no IntelliTrace Events.
(1) Please add a breakpoint in your app, and then debug it, after the breakpoint was hit, check the Event.
(2) I think you could enable the IntelliTrace under TOOLS->Options->IntelliTrace, please enable IntelliTrace. Debug it again.
(3) Of course, not very sure that whether it is related to the project type, for example, just create a simple Winform app, test it again.
I’m using Visual Studio 2010 to write unmanaged C++ code.
When debugging, anything printed using OutputDebugString or MFC’s TRACE macro goes to Visual Studio’s “Output” window.
I would prefer to see the output in DebugView instead, while still running under the MSVC debugger. Is this possible?
It is not possible. Whatever debugger the app runs in gets first dibs on any such messages. DebugView can only intercept the messages when the app is not running inside of any debugger.
likely not possible, by design.. if you open two DebugView instances, there's also only one receiving the messages.
I have a solution comprising of about 6 projects, and when I debug on one machine, any un-handled exceptions that occur cause the environment to break at the point that exception is thrown, allowing me to debug it.
However, on a different machine with the same solution (in the same version of VS), all I get when an exception is thrown is the "Visual Studio Just-In-Time debugging" window popping up, which tells me the name of the exception, and little else - it offers to open a new visual studio instance in order to debug it, but that doesn't work, because it is already being debugged by the IDE!
What is going on, and how can I get back to visual studio telling me where the exception happened?
Cheers
You might want to check Exceptions in the Debug menu (mapped by default to Ctrl+Alt+E) and verify that both machines have the same exceptions selected.
Probably on the second machine you have less exception types selected in that window. When one of the exceptions that are not selected is thrown:
the debugger does not handle it because it has been instructed not to
the exception gets passes to the OS
the OS launches the default system-wide debugger which is the "Visual Studio Just-In-Time debugging" launcher if you installed VS2005 on that machine.
Sounds like it can't find the debug info.
Try copying the PDB files to your output directory.
I've had this problem as well - two machines, identical exception settings, different behaviours. The solution for me was to set the Debugger Type in the project properties on the "bad" machine to Mixed, even though the application only contains managed code. On the "good" machine exceptions are caught in Visual Studio using the Managed Only setting.
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 :)
My VS 2008 has a lot of plugins such as Resharper, Syncfusion, Typemock, TestDriven.net and you-name-it. And I am always running all of them on the latest beta versions.
The problem is that this morning the VS 2008 crashed when it was loading Windows Form designers. I think it must be due to Syncfusion ( version 7.2.0.20), or its interaction with other add-ons such as Resharper. Just to be sure, I need to have access to the stack trace before it crashed so that I can get the vendors to fix the problem.
Any idea where the exception trace is logged when VS 2008 crashes, or is there anyway I can obtain the stack trace?
P/S: there is this log switch command in devenv command, but from what I learn, it's only logging the activities, not the stack trace.
If you'd rather not have another instance of VS running in the background, you can use adplus instead. Just attach it to the VS instance you use for dev, and have it create a full dump in case VS crashes. This way, you won't have any overhead while doing your regular work with VS, and in case it crashes you'll have the full context of the crash.
Start another Visual Studio instance, go to Tools -> Attach to a process, and select the instance that should be debugged here. This will give you the ability to break into the debugger when the problematic instance crashes.