Allow preserving stack traces when rethrowing exceptions. - by Stephen Cleary

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 633822 Comments
Status Closed Workarounds
Type Suggestion Repros 0
Opened 12/29/2010 11:42:54 AM
Access Restriction Public


When re-throwing an exception (commonly a nested or inner exception), it would be nice to have the ability to preserve the stack trace.

The Exception class already has a method for this (PrepForRemoting), which is invoked via Reflection by Rx, the Async CTP, and end-user libraries who need this functionality.

The fact that several different libraries all invoke this method via Reflection indicates that it would be better as a public API.
Sign in to post a comment.
Posted by Microsoft on 1/14/2011 at 12:37 PM
Hi Stephen,

Thanks for taking the time to make this suggestion. We have addressed this issue for the next release of the .NET Framework. Some of the people you mentioned as using PrepForRemoting had brought this to our attention even before this bug. PrepForRemoting has a few things specific to remoting, so we ended up adding a new more general mechanism. I'm going to resolve this issue as fixed. If you don't think the issue is solved after trying the next release of the framework, feel free to reactivate it.

CLR Team
Posted by Microsoft on 12/29/2010 at 12:17 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(