0
votes
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.

1

1 Answers

1
votes

As you can read in the MSDN documentation available at http://msdn.microsoft.com/en-us/library/windows/apps/hh967755.aspx:

The app's install directory is a read-only location.