How can the errors in Visual Studio be displayed as in this image:
instead of using the Error List?
The exceptions I get are displayed like this:
(The images are from: How to tell the debugger to ignore breaking on thrown exceptions?, Where did my Visual Studio exception assistant go?)
If you look under Tools | Options in the Debugging | General node, be sure your "Enable the Exception Assistant" is checked.
The error message that is displayed in the first picture is a message displayed for .Net exceptions. (Anything that inherits from System.Exception)
The .Net exception class has members that include data and stack trace that can be displayed nicely and the Visual Studio IDE displayes it for you.
Native errors (from native code or windows code, anything not .Net) is displayed with the second window.
Native exceptions to contain a minimal what() string. Sometimes. But any other class type can be thrown too, so there's not always that much information.
Related
I'm using .NET Core 2.2 with EF and when queries are being run against database, I see a bunch of ArgumentExceptions being logged in the Output -> Debug window such as:
Exception thrown: 'System.ArgumentException' in System.Linq.Expressions.dll
The thing is my app is working perfectly fine, I get proper results and everything. I see like a hundred of these in the Visual studio's debug for no apparent reason.
Is there anyway I could find more information about these exceptions? Maybe let Visual studio break on them or something like that?
Edit: This did not happen on a different machine. I guess something bad is happening with my system and I could not tell what.
So, the answer is to enable System.ArgumentException at Visual Studio setting Debug -> Windows -> Exception Settings->Common Language Runtime Exceptions.
I'm using Web Api and when an exception happens in my code (for example a bad cast), and the debugger is attached, the exception is not thrown in Visual Studio. I just get the 500 internal server error on the browser side with the exception details but it's a pain because I have to track down what line it's thrown on.
I don't believe this was always the case, and thought it must be one of my settings messed up but I have already tried to reset visual studio settings to no avail.
How can I get the debugger to break again on 500 internal server errors.. I don't want to enable first chance exceptions.
Tools -> Options -> Debugging -> General, Ensure that "Enable Just My Code" is checked.
In visual studio Debug->Exceptions for exceptions that you need or for all of them select checkbox in the Throw column. It's because by default Asp.Net runtime handles all exceptions. MSDN
There's a really weird bug in my app (C#, WPF based UI): in a certain scenario, if I unpin the explorer, I'm getting tons of exceptions (System.NullReferenceException – Object reference not set to an instance of an object).
The problem is: I can't find the specific reason for this exception because Visual Studio stops debugging (so there is no stacktrace, and no evidence for the exception).
I tried changing the exception handling settings in VS to throw any exception instead of handling it, but it didn't help.
How can I find the exact location which threw the exception?
I'm trying to debug a legacy VB6/ASP/COM+ application using Visual Studio 2010. The COM+ DLL has been compiled with full debug information and has the corressponding .PDB files. I attach to the dllhost process of the COM+ component and during execution when an exception is thrown, I'm unable to see the details of the error in the debugger.
Typing Err into the immediate window displays 0. Typing Err.Description displays CXX0025: Error: operator needs class/struct/union.
The locals window doesn't show any error or exception information. How can I view the details of a thrown exception?
Update
I'm still not able to view error information or properly inspect variables and objects. I'm also using Visual Studio 2010 to debug the classic ASP pages (VBScript) parts of the application and it seems to have a full featured debugging experience, i.e. I can inspect variables and objects properly. Since classic ASP with VBScript is a close cousin of VB6 and they're both COM based, should I not be able to inspect VB6 errors, variables and objects properly too?
You normally need an IDE for the langauge it was originally written in so VB6 for the VB6 components, VS6 for the ASP components?
Hello I'm getting this exception thrown at me whenever I try to test a web application via visual studio, any ideas why? I'm building a project using MVC3 model and visual studio 2010
Exception: A first chance exception of type 'StructureMap.StructureMapException' occurred in StructureMap.DLL
First chance exceptions might occur while debugging. They might be handled properly by your code and never propagate when running the application normally but nevertheless Visual Studio shows them in Debug mode. If you don't want to be bothered you could disable them in Visual Studio and they will no longer appear.