tagged [stack-trace]

Can I get the stack traces of all threads in my c# app?

Can I get the stack traces of all threads in my c# app? I'm debugging an apparent concurrency issue in a largish app that I hack on at work. The bug in question only manifests on certain lower-perform...

StackTrace filename unknown

StackTrace filename unknown Something strange is happening in my code where I'm using a StackTrace. It's almost as if the debug info is not being loaded... but I'm running this on the DEBUG build.The ...

30 Oct at 18:4

Reading .Net Stack Trace

Reading .Net Stack Trace This question came just out of curiosity to know our friend the a little better. As a C# (.NET) developer every one must have seen a yellow stack trace like the one below. ![e...

21 Aug at 19:33

How can I tell the compiler to ignore a method in stack traces?

How can I tell the compiler to ignore a method in stack traces? Are there any attributes I can apply to boilerplate methods so that such methods do not appear in stack traces? I've got a lot of them a...

20 Jun at 09:12

How to send a stacktrace to log4j?

How to send a stacktrace to log4j? Say you catch an exception and get the following on the standard output (like, say, the console) if you do a : Now I want to send this instead to a logger like, say,

3 Dec at 16:49

Display lines number in Stack Trace for .NET assembly in Release mode

Display lines number in Stack Trace for .NET assembly in Release mode Is there a way to display the lines in the stack trace for the .NET assembly build/deployed in Release mode? My application is di...

How to get line number(s) in the StackTrace of an exception thrown in .NET to show up

How to get line number(s) in the StackTrace of an exception thrown in .NET to show up MSDN says this about the `StackTrace` property of the `Exception` class: > The StackTrace property holds a stack ...

24 Sep at 23:19

Stack trace with incorrect line number

Stack trace with incorrect line number Why would a stack trace show "line 0", ? eg. ``` ... at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCo...

13 May at 15:8

Do not show file paths of build machine in stack trace

Do not show file paths of build machine in stack trace I am currently developing a C# application which has got it's own logging. When exceptions are thrown, the exception is saved into a list which c...

How do I get ruby to print a full backtrace instead of a truncated one?

How do I get ruby to print a full backtrace instead of a truncated one? When I get exceptions, it is often from deep within the call stack. When this happens, more often than not, the actual offending...

20 Jun at 00:18

what can lead throw to reset a callstack (I'm using "throw", not "throw ex")

what can lead throw to reset a callstack (I'm using "throw", not "throw ex") I've always thought the difference between "throw" and "throw ex" [was that throw alone wasn't resetting the stacktrace of ...

23 May at 12:32

How to rethrow the inner exception of a TargetInvocationException without losing the stack trace

How to rethrow the inner exception of a TargetInvocationException without losing the stack trace I have many methods which are calling using `Delegate.DynamicInvoke`. Some of these methods make databa...

Why does the Stack Trace shows my development files path?

Why does the Stack Trace shows my development files path? Visual Studio 2010 SP1, compiled WCF app, put it on a server, and of course it got an error on the first run (what's new), outputted Stack Tra...

Why is exception.printStackTrace() considered bad practice?

Why is exception.printStackTrace() considered bad practice? There is a lot of [material](http://fahdshariff.blogspot.com/2010/10/redirect-stdout-to-logger.html) out [there](http://checkstyle.sourcefor...

Is it possible to get a good stack trace with .NET async methods?

Is it possible to get a good stack trace with .NET async methods? I have the following sample code setup in a WebApi application: ``` [HttpGet] public double GetValueAction() { return this.GetValue(...

How can I rethrow an Inner Exception while maintaining the stack trace generated so far?

How can I rethrow an Inner Exception while maintaining the stack trace generated so far? Duplicate of: [In C#, how can I rethrow InnerException without losing stack trace?](https://stackoverflow.com/q...

23 May at 12:24

How do I get the executing object for a stackframe?

How do I get the executing object for a stackframe? When using reflection it is possible to obtain the call stack (apart from that it can be a crude approximation due to JIT optimizations) using Syste...

20 May at 18:29

Print stack trace information from C#

Print stack trace information from C# As part of some error handling in our product, we'd like to dump some stack trace information. However, we experience that many users will simply take a screensho...

30 Sep at 23:15

Wrong line number in stack trace for exception thrown inside switch statement

Wrong line number in stack trace for exception thrown inside switch statement I have noticed a strange behavior with the line number in an exception's stack trace if the exception is thrown inside a `...

23 Jul at 13:37

Stop displaying entire stack trace in WebAPI

Stop displaying entire stack trace in WebAPI When an unexpected error occurs in `WebAPI` the user sees the entire stack trace. I believe that showing the entire stack trace is not safe. What is the de...

Wrong file path and line number in Exception stack traces from dynamic code

Wrong file path and line number in Exception stack traces from dynamic code We are using System.Reflection.Emit to generate code at runtime from source code (yes - as in a compiler). We provide correc...

crash in ComboBox coerce (not my code)

crash in ComboBox coerce (not my code) I got the stack trace below reported from a customer. I don't know how to reproduce this. My WPF application has a fair number of ComboBoxes; I'm not sure how to...

27 Mar at 17:24

Stack traces with async/await

Stack traces with async/await It's clear why stack traces are affected with Microsoft's new programming paradigm. We now have a semantic stack and a couple of physical ones (my choice of words). What ...

ASP.NET Core 2.0 using Serilog to log stacktrace when exception is thrown

ASP.NET Core 2.0 using Serilog to log stacktrace when exception is thrown So I've recently started to build a asp.net core application and for the logging i'm using SeriLog. This was working fine unti...

exception with no stack trace - how?

exception with no stack trace - how? We have a service which will log unhandled exceptions at the app domain level (via Log4net). We logged: > 2014-01-28 16:49:19,636 ERROR [49] FeedWrapperService - u...