I haven't dug into this one yet, but here is a small repro of an exception that comes from deserializing DbUpdateExceptions:
var formatter = new BinaryFormatter();
Exception ex;
using (var ms = new MemoryStream())
{
formatter.Serialize(ms, new DbUpdateException("foo"));
ms.Position = 0;
// Works fine
ex = (Exception)formatter.Deserialize(ms);
}
using (var ms = new MemoryStream())
{
formatter.Serialize(ms, ex);
ms.Position = 0;
// Exception happens here on 2nd deserialize
ex = (Exception)formatter.Deserialize(ms);
}
Thoughts?
Comments: unit test coverage is sufficient, closing
var formatter = new BinaryFormatter();
Exception ex;
using (var ms = new MemoryStream())
{
formatter.Serialize(ms, new DbUpdateException("foo"));
ms.Position = 0;
// Works fine
ex = (Exception)formatter.Deserialize(ms);
}
using (var ms = new MemoryStream())
{
formatter.Serialize(ms, ex);
ms.Position = 0;
// Exception happens here on 2nd deserialize
ex = (Exception)formatter.Deserialize(ms);
}
Thoughts?
Comments: unit test coverage is sufficient, closing