Hello,
I try to port a game into UWP for windows 10 but I have some issues that I don’t have in normal PC build.
One of them is that the access to Application.persistentDataPath is denied when doing that File.Create(path).
I got this error :
Is there something to launch game with admin access (by doing build and run or when debuging with visual studio) ? some authorization to setup in the project?
Thank in advance
EDIT:
In fact the problem come when trying to create two files in the same directory like this :
using (FileStream file = File.Create(path1))
{
bf.WriteObject(file, SaveManager.allSavedData);
file.Dispose();
}
using (FileStream file = File.Create(path2))
{
file.Dispose();
}
Here path1 and path2 are Application.persistentDataPath + separator + a name.
The error come when creating at path2. In .Net you cannot use stream.Close(), but with using and dispose it should leave the access , right?
EDIT2 :
I’m dumb, nevermind.
The problem was a missing separator and you don’t have access to ‘C:\Users\AppData\Local\Packages\MyGame’ but to ‘C:\Users\AppData\Local\Packages\MyGame\LocalState’.