Reputation: 48
I want to refer to a grammar file in my project(Rootfile->folder named grammar->the file named NumbersGrammar) I used this line of code but it tells me the 0x80070002 error (the system cannot find the file specified):
Uri Numbers = new Uri("ms-appx:///Grammar/NumbersGrammar.grxml" ,UriKind.Absolute);
Upvotes: 3
Views: 1212
Reputation: 6424
Make sure that the file exists in the specified location, and it's Build Action
property is set to Content
:
Upvotes: 4
Reputation: 6456
Have you tried using appdata
instead? In your case the full path would be
new Uri("appdata:/Grammar/NumbersGrammar.grxml");
Apparently although appdata
and ms-appx
both refer to the installation folder, they must be used for different situations.
Upvotes: 0