I just created a new blank XAML/C# Windows Store app in Visual Studio. I tried to create a file in the Documents folder with this code:
// DEBUG ONLY:
StorageFile file = await KnownFolders.DocumentsLibrary.CreateFileAsync("Hey lol.txt");
But it throws this exception (which I expected):
WinRT information: Access to the specified location (DocumentsLibrary) requires a capability to be declared in the manifest.
Which is fine. I expected it. So I go to Package.appxmanifest
and go to Capabilities
tab, and to my surprise, there is no "DocumentsLibrary" capability listed.
How do I enable it if it's not even there?
Looks like your answer is here. The author shows it available in VS2012, but gone from the list in VS2013, citing MS policy against accessing that particular folder.