csla icon indicating copy to clipboard operation
csla copied to clipboard

Remove requirement for Serializable attribute

Open rockfordlhotka opened this issue 1 year ago • 4 comments

Microsoft is removing support for BinaryFormatter in .NET 9, and presumably this means they might remove the SerializableAttribute type.

https://github.com/dotnet/runtime/issues/98245

CSLA never really used this, but does require it as a vestige of when we used to support BinaryFormatter.

CSLA should no longer require the use of the Serializable attribute for serializable types.

rockfordlhotka avatar Feb 12 '24 22:02 rockfordlhotka

We can't remove the attribute, it would be too breaking :) It's just nothing will care about it.

blowdart avatar Feb 14 '24 15:02 blowdart

@blowdart agreed - though Microsoft might remove the attribute (I don't know).

rockfordlhotka avatar Feb 14 '24 16:02 rockfordlhotka

In this case I am Microsoft. We don't have any plans to remove it as yet.

A much more detailed white paper will be coming soon, my issue in the dotnet repo is really just an overview. Hopefully that will set your mind to rest, but honestly removing the requirement is probably a decent idea if your serializers don't need it.

blowdart avatar Feb 14 '24 16:02 blowdart

That's excellent Barry, I wasn't really paying attention to the identity of the person doing the reply 🫢

I agree with the idea that removing the attribute from .NET would be a massive breaking change.

In the case of CSLA though, removing the checks that require it (I think) makes sense, because other serializers (including the one that's now default in CSLA) don't use it for anything - it was literally a vestige of the way CSLA was originally based on BinaryFormatter 20 years ago.

rockfordlhotka avatar Feb 14 '24 20:02 rockfordlhotka