Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve exception stack trace does not handle non-serializable exceptions #1314

Closed
SimonCropp opened this issue Jul 17, 2013 · 1 comment
Closed
Milestone

Comments

@SimonCropp
Copy link
Contributor

If an exception is thrown that does not properly implement ISerilizable we cannot preserve the stack trace. As in it will throw a SerializationException

An example of how to "not properly implement ISerilizable" is forgetting to add the custom contructor

protected MyException(SerializationInfo info, StreamingContext context)

so you exception would look like this

public class MyException: Exception
{
}

This should be fairly rare since it is one of the exception design guidelines http://msdn.microsoft.com/en-us/library/vstudio/ms229064(v=vs.100).aspx

Do make exceptions serializable. An exception must be serializable to work correctly across application domain and remoting boundaries.

The workaround

If this is happening to people during development the easiest way to diagnose the underlying issue is to use "Break on all exceptions" http://msdn.microsoft.com/en-us/library/vstudio/d14azbfh.aspx

image

@ghost ghost assigned SimonCropp Jul 17, 2013
@SimonCropp
Copy link
Contributor Author

fixed in d761b0e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant