3 ms·
Active C# dev here, but I haven’t read the article. For configuration these days XML is generally not used, they have a configuration system which can use a va
by jonathanlydall 2y ago
Active C# dev here, but I haven’t read the article.
For configuration these days XML is generally not used, they have a configuration system which can use a variety of underlying sources (like environment variables and JSON files) and you can either access these settings by key from a dictionary or trivially hydrate a plain old C# classes, including with collections.
People may still manually read their own configuration independent of this system or perhaps they’re just generally deserialising XML.
There are (I think) at least a few ways to work with XML in .NET.
For well known schemas I definitely generally recommend the C# class approach where you somewhat simply deserialize a file into well typed C# classes.
From your question it sounds like the XML API which allows you to arbitrarily query or manipulate XML directly was used here. I have on occasion used this when I don’t have the full schema for the XML available and need to tweak a single element or search for something with XQuery. It’s a useful tool for some scenarios, but a poor choice for others.
- Adachi91 2y agoSystem.Xml has been around for a very long time. I use it in one of my tools as a MSN deserialization class to make all my old MSN history "readable" by traversing the nodes and picking out sending/receiving user, timestamp, and message.