Sporadic UnauthorizedAccessException on IsolatedStorage

I have a weird issue with savegames. This only happens once, when the app is freshly installed - restarting the app solves the issue and saving works just fine. It also happens just on some devices.

This is the code used - I think it’s straightforward:

using (IsolatedStorageFile storage = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null))
                {
                    using (IsolatedStorageFileStream fs = storage.OpenFile(filename, System.IO.FileMode.Create))
                    {
                        fs.Write.....

afaik the exception is thrown at FileStream creation - any ideas would could be wrong? What puzzles me, is that it works once, tha app is restarted (and not running for the first time)

noone an idea what could be the cause of this error - I think I use it correctly but maybe I do something wrong?

Does not seem related to MonoGame thus, maybe, the lack of answers.

Not really related I guess - but as most games need some sort of saving the gamestate, I was hoping someone had a similar issue together with a solution :slight_smile:

I recently read some stuff about Robo Miner 2 (a tweet I think) that mentioned a similar issue.

PS :
The link https://play.google.com/store/apps/details?id=com.rnet.robominer2.
And your are the author of Robo Miner 2 :slight_smile:

Does the user need to authorize your app to access storage ?

oh no - bad publicity spreads :slight_smile:

I do actually not require any permissions for file saving, because afaik, there aren’t any for writing to internal storages’ app-space.

Not sure if my used StorageScope does somehow still need some special permissions to be set … but that’s at least a new direction to investigate into.

omg … soution found - and it’s pretty simple (and I am stupid)

I some condition I supply an empty filename … which results in unauthorizedaccess Exception

Great !

I can remove the reference to your game if you want :wink:

na, it’s ok, I did a showcase here anyway, so everyone knows :slight_smile: