我的解决方案中有一个名为“XMLData”的文件夹,下面有一个名为Questions.xml的文件
我在app.xaml上有以下代码
public static XDocument doc = XDocument.Load("./XMLData/Questions.xml");
当我启动应用程序时,visual studio给出了以下错误:
An unhandled exception of type 'System.Xml.XmlException' occurred in System.Xml.dll
Additional information: Cannot open './XMLData/Questions.xml'.
The Uri parameter must be a relative path pointing to content inside the Silverlight application's XAP package.
If you need to load content from an arbitrary Uri, please see the documentation on Loading XML content using WebClient/HttpWebRequest.
我该如何解决?
我试过
/XMLData/Questions.xml
XMLData/Questions.xml
../XmlData/Questions.xml