StorageFolder InstallationFolder = Windows.ApplicationModel.Package.Current.InstalledLocation;
StorageFile file = await InstallationFolder.CreateFileAsync("MyDocument.Txt", CreationCollisionOption.ReplaceExisting);
await FileIO.WriteTextAsync(file, "Hello");
The error is:
An exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll but was not handled in user code
Additional information: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
If there is a handler for this exception, the program may be safely continued.