Files uploaded with Device Portal gives “Access denied” at runtime

Now here’s a nice nut to crack: I was trying to write some code to read the settings file generated by IsolatedStorageSettings in Silverlight for Windows Phone. The file is named “__ApplicationSettings” and if it was located, it should be loaded, read and the contents parsed.

Sounds simple enough.

I opened Device Portal which lets me see the files in the local storage of the new UWP app and also lets me upload new files. I upload a test file which contains some sample data and run the app to see if the logic works.

No such luck.

I get an UnauthorizedAccessException. And no matter how I try to read the file, it won’t let me. After trying to google around the interwebs, asking some select people and reading this excellent post by Pedro Lamas, I was getting nowhere.

It wasn’t until Rodrigo Diaz pointed out that maybe the Device Portal was the problem. I then tried using the “IsolatedStorageExplorer” tool for Windows Phone 8.1 and upload the file to the device that way.

IT WORKS!

It looks like the Device Portal uploads the files with some sort of weird permissions. I haven’t seen anyone else having this problem when searching, but I might have looked in the wrong places. The weird thing is though, the IsolatedStorageExplorer wasn’t able to read the files either, but writing went fine. Weird…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s