I am new to XML serialization in C#. I want to serialize my Dependency object instance so that it looks like this:
<Dependency Software="Some software">some value</Dependency>
I tried this:
public class Dependency{
[XmlAttribute("Software")]
public string soft;
public string value;
}
However, the output looks like the below which is not what I want:
<Dependency Software="Some Software">
<value>some value</value>
</Dependency>
Is there any way to achieve my desired output?