How do I store an XML value in my .NET App.Config file

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 07:54:31

You can save an XML document as text in an attribute value if you escape the character entities:

<FieldRef Name="Linkfilename" ...

You can then use XmlDocument.Load() to parse the text value.

Note that this won't work for your example because your value is an XML document fragment and not a well-formed XML document. You either need to wrap it in an enclosing document element (whose markup will still be escaped) or use a properly-initialized XmlReader to process the value once you've retrieved it from the configuration.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!