Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[corlib] version tolerant serialization fails with missing primitive …
…members Modifies ObjectReader so that when it encounters a primitive typed member in an object stream which has no corresponding member in the app domain, it will read the value anyway and throw it away. That way it can read the next block from the stream. Added a unit test which passes with the changes to ObjectReader. Fixes bug #641821.
- Loading branch information
Showing
4 changed files
with
49 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...rs.Binary/VersionTolerantSerialization/VersionTolerantSerializationTestLib/6.0/Address.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Runtime.Serialization; | ||
|
||
namespace VersionTolerantSerializationTestLib | ||
{ | ||
[Serializable] | ||
public class Address | ||
{ | ||
private string Street; | ||
private string City; | ||
private string CountryCode; | ||
|
||
[OptionalField (VersionAdded = 4)] | ||
private string PostCode; | ||
|
||
[OptionalField (VersionAdded = 5)] | ||
private string AreaCode = "0"; | ||
|
||
[OptionalField (VersionAdded = 6)] | ||
private int Id = 0; | ||
} | ||
} |