ValveKeyValue
                                
                                 ValveKeyValue copied to clipboard
                                
                                    ValveKeyValue copied to clipboard
                            
                            
                            
                        Why are object members sorted by name?
This loses developer defined order in classes when serializing.
https://github.com/SteamDatabase/ValveKeyValue/blob/ed10cc104681d33935fc2b7ea3d6701970a581f5/ValveKeyValue/ValveKeyValue/ObjectCopier.cs#L120
cc @yaakov-h
Probably for consistency/reliability, particularly for the unit tests.
In .NET 6 and earlier versions, the GetProperties method does not return properties in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which properties are returned, because that order varies. However, starting with .NET 7, the ordering is deterministic based upon the metadata ordering in the assembly.
-- https://learn.microsoft.com/en-us/dotnet/api/system.type.getproperties?view=net-7.0#system-type-getproperties
Right, that makes sense.
Perhaps we can order by MetadataToken, is that what .NET7 does?
I'm not sure what .NET 7 runtime does, its very hard to dig through this bit of the BCL/CLR codebase.