stacktrace behavior in release/debug and in windows forms

  • Thread starter Thread starter Sankar Nemani
  • Start date Start date
S

Sankar Nemani

Hi All,
StackTrace property of the exception object does not
seem to contain complete stack information in the release
version of a console application. In a windows forms
application(both release and debug versions) and in debug
version of console apps, it shows the complete stacktrace.
Does anyne know why it does that or know of any resources
that explain the working of exception stacktrace?
TIA
Sankar Nemani
 
In a release build, certain functions can be inlined for better performance,
which can cause the StackTrace behaviour you are seeing. The behaviour is
not unique to Console apps, and can occur in Windows Forms apps too. If you
need to see a certain function in a stack trace, you can apply the
MethodImplAttribute with the NoInlining flag.

Nick Wienholt, MVP
Maximizing .NET Performance
http://www.apress.com/book/bookDisplay.html?bID=217
Sydney Deep .NET User Group www.sdnug.org
 
Back
Top