I am using C# (.Net 2.0) to develop windows application. I need to store nearly 50 to 60 user settings. Can anyone, please, tell which is better of the following?
Binary Serialization or Application Settings (user.config)
Thank you.
I am using C# (.Net 2.0) to develop windows application. I need to store nearly 50 to 60 user settings. Can anyone, please, tell which is better of the following?
Binary Serialization or Application Settings (user.config)
Thank you.
It depends on your needs.
Binary is faster of course, and you can use it if you have a large amount of data, when
User application settings if performance is not such a big concern and you want it to be human-readable.
Do you want to be able to edit them easily, without writing your own interface? Then the application settings is the way to go.
But if you may be storing complex types, and there is no requirement to edit outside of the fashion you allow, then BinarySerialization
would be preferable. You may need to elaborate a bit, but I think the Application Settings may be a fine approach.
App-settings is built in, works, and has IDE support.
Performance isn't really an issue for this small set of data; re binary, I would actively avoid BinaryFormatter
in this case, since app-settings typically evolve between versions, and BinaryFormatter
is very brittle when it comes to versioning. There are other ways to serialize data as binary, but in this case I'm not sure I'd bother...