You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, because of BinaryFormatter deprecation we are looking for alternatives.
MessagePack for C# isn't one due to not supported cyclic references.
Ceras looks good so far.
For binary formatter our developers are decorating the classes using the [Serializable] Attribute.
If they have Data which should not be serialized, they use the [NonSerialzed] Attribute on Fields. (only on fields possible)
There are tons of code like this:
[Serializable]
public class Sample
{
[NonSerialized]
private int fMyProperty1;
public int MyProperty1 { get => fMyProperty1; set => fMyProperty1 = value; }
public int MyProperty2 { get; set; }
}
In Order to get it working we have to change this tons of code into:
[Serializable]
[MemberConfig(TargetMember.All)]
public class Sample
{
[NonSerialized]
[Exclude]
private int fMyProperty1;
[Exclude]
public int MyProperty1 { get => fMyProperty1; set => fMyProperty1 = value; }
public int MyProperty2 { get; set; }
}
Question 1:
Is there any chance to provide a BinaryFormatter Replacement Mode?
This mode should use existing attributes and not require attributes on fields AND properties.
Question 2:
YES, we also add fields and properties to our classes during the further development and we assume that this makes no problems on deserialization. Of course we accept compromises in volume.
Is that possible or will it be possible?
Thank You in advance
Best Regards
The text was updated successfully, but these errors were encountered:
Hi GunSharp,
unfortunately no, either we will use the unsupported Formatter which will be provided by MS as Nuget-Package, or we will copy the code from .NET 8 and move it to our source base.
Hi, because of BinaryFormatter deprecation we are looking for alternatives.
MessagePack for C# isn't one due to not supported cyclic references.
Ceras looks good so far.
For binary formatter our developers are decorating the classes using the [Serializable] Attribute.
If they have Data which should not be serialized, they use the [NonSerialzed] Attribute on Fields. (only on fields possible)
There are tons of code like this:
[Serializable]
public class Sample
{
[NonSerialized]
private int fMyProperty1;
}
In Order to get it working we have to change this tons of code into:
[Serializable]
[MemberConfig(TargetMember.All)]
public class Sample
{
[NonSerialized]
[Exclude]
private int fMyProperty1;
}
Question 1:
Is there any chance to provide a BinaryFormatter Replacement Mode?
This mode should use existing attributes and not require attributes on fields AND properties.
Question 2:
YES, we also add fields and properties to our classes during the further development and we assume that this makes no problems on deserialization. Of course we accept compromises in volume.
Is that possible or will it be possible?
Thank You in advance
Best Regards
The text was updated successfully, but these errors were encountered: