Reputation: 29
I am working on XNA with XML reading. While I'm debugging the code its shows file not found error, but I added my XML file in Content
reference folder. While I'm using this code I got the error.
System.IO.Stream stream = TitleContainer.OpenStream("ProductSchema");
Thanks in advance.
Bharathi.G
Upvotes: 0
Views: 316
Reputation: 145
Check whether that file is present in the bin folder where your game .exe file lives (bin\Windows Phone\Debug\Content). If not, then this may be the problem. To solve this :
right click the file >> select property >> change build action to None and copy to output directory to Copy if newer.
This works for me while loading/reading binary files in my game.
Upvotes: 0
Reputation: 69372
Try adding the extension:
System.IO.Stream stream = TitleContainer.OpenStream("ProductSchema.xml");
Upvotes: 0