问题
I added a folder to my project and I added an xml file to the folder. Set Build Action of file as Resource. Now try to load the file using line given below
XDocument xDoc = XDocument.Load("Xml/MyXML.xml");
The project compiles successfully but while running I get the below exception:
Cannot find file 'WORDXML.xml' in the application xap package.
Also, i checked the created XAP and not find anything related to folder.
Could anybody help me out where I am missing
回答1:
You need to set the build action to Content
. Or otherwise you need to load it as a resource, with Application.GetResourceStream
来源:https://stackoverflow.com/questions/8091818/xml-file-not-found-in-xap