Reading xml file causes HRESULT: 0xC00CE556 [duplicate]

淺唱寂寞╮ 提交于 2020-01-11 13:35:28

问题


I am writing a Windows 8.1 store app and I need to read a local xml file produces a general error trying to load the file.

Here's the file and code:

XmlDocument doc = new XmlDocument();
doc.LoadXml(@"C:\Users\Martin\Desktop\eventList2.xml");


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<EventList>1</EventList>

回答1:


doc.LoadXml() expects XML string as parameter. To load XML from file, use doc.Load(@"C:...");



来源:https://stackoverflow.com/questions/26952259/reading-xml-file-causes-hresult-0xc00ce556

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