UnauthorizedAccessException on .tmp file?

Discussion and help for Easy Save 3
Post Reply
cjygame
Posts: 5
Joined: Fri Dec 03, 2021 2:01 am

UnauthorizedAccessException on .tmp file?

Post by cjygame »

Hi Joel,

I am in the process of building an application for Nintendo Switch. I had to clone my project and then open the project in Unity Editor with Nintendo add-on built into it. However, ever since this transfer, I keep getting this error below when I launch the application. The application gets / sets some initial values for the save data so the timing is expected behavior, but this error never occurred in the original version.

So far, I've tried:
1) Reimporting All
2) Delete Library folder
3) Delete and reinstall EasySave3 via Package Manager
4) Delete all previous or similar named .es3 files that was before
5) Changed the path string several different ways
6) Tweaked several settings in the EasySave3 Settings / Tools (which I reverted back after the error persisted)

From what I can tell, it looks like .tmp (temporary file?) is being created directly onto my C: and the computer is blocking the access for that. But no matter what I add as the path, it always throws "C:\MYSAVEDATA.es3.tmp" as the path instead of the usual path with Application.persistentPath in it. I would expect "C:/Users/MYUSERNAME/AppData/LocalLow/MYCOMPANYNAME/MYGAMENAME/MYSAVEDATA.es3.tmp" to be the correct path but I don't know what else I can do at this point. Any help or guidance would be much appreciated.

Unity version is 2022.3.26f1.

UnauthorizedAccessException: Access to the path "C:\MYSAVEDATA.es3.tmp" is denied.
ES3Internal.ES3Stream.CreateStream (ES3Settings settings, ES3Internal.ES3FileMode fileMode) (at Assets/Utility/Easy Save 3/Easy Save 3/Scripts/Streams/ES3Stream.cs:70)
ES3Writer.Create (ES3Settings settings, System.Boolean writeHeaderAndFooter, System.Boolean overwriteKeys, System.Boolean append) (at Assets/Utility/Easy Save 3/Easy Save 3/Scripts/Writers/ES3Writer.cs:409)
ES3Writer.Create (ES3Settings settings) (at Assets/Utility/Easy Save 3/Easy Save 3/Scripts/Writers/ES3Writer.cs:403)
ES3.Save[T] (System.String key, T value, ES3Settings settings) (at Assets/Utility/Easy Save 3/Easy Save 3/Scripts/ES3.cs:109)
ES3.Save[T] (System.String key, T value) (at Assets/Utility/Easy Save 3/Easy Save 3/Scripts/ES3.cs:72)
UnityEngine.Localization.Settings.StartLocaleSelector.PostInitialization (UnityEngine.Localization.Settings.LocalizationSettings settings) (at Assets/Sunpeak Game/SCRIPTS/StartLocaleSelector.cs:20)
UnityEngine.Localization.Operations.InitializationOperation.PostInitializeExtensions () (at ./Library/PackageCache/com.unity.localization@1.4.4/Runtime/Operations/InitializationOperation.cs:98)
UnityEngine.Localization.Operations.InitializationOperation.FinishInitializing (System.Boolean success, System.String error) (at ./Library/PackageCache/com.unity.localization@1.4.4/Runtime/Operations/InitializationOperation.cs:111)
UnityEngine.Localization.Operations.InitializationOperation.FinishInitializing (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle op) (at ./Library/PackageCache/com.unity.localization@1.4.4/Runtime/Operations/InitializationOperation.cs:106)
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1+<>c__DisplayClass60_0[TObject].<add_CompletedTypeless>b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[TObject] s) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:332)
DelegateList`1[T].Invoke (T res) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.Debug:LogException(Exception)
DelegateList`1:Invoke(AsyncOperationHandle`1) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Runtime/ResourceManager/Util/DelegateList.cs:79)
UnityEngine.ResourceManagement.AsyncOperations.<>c__DisplayClass60_0:<add_CompletedTypeless>b__0(AsyncOperationHandle`1)
DelegateList`1:Invoke(AsyncOperationHandle`1) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.ResourceManagement.AsyncOperations.<>c__DisplayClass60_0:<add_CompletedTypeless>b__0(AsyncOperationHandle`1)
DelegateList`1:Invoke(AsyncOperationHandle`1) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.ResourceManagement.AsyncOperations.<>c__DisplayClass60_0:<add_CompletedTypeless>b__0(AsyncOperationHandle`1)
DelegateList`1:Invoke(AsyncOperationHandle`1) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.ResourceManagement.AsyncOperations.<>c__DisplayClass60_0:<add_CompletedTypeless>b__0(AsyncOperationHandle`1)
DelegateList`1:Invoke(AsyncOperationHandle`1) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.ResourceManagement.AsyncOperations.<>c__DisplayClass60_0:<add_CompletedTypeless>b__0(AsyncOperationHandle`1)
DelegateList`1:Invoke(AsyncOperationHandle`1) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Runtime/ResourceManager/Util/DelegateList.cs:75)
UnityEngine.ResourceManagement.Util.DelayedActionManager:LateUpdate() (at ./Library/PackageCache/com.unity.addressables@1.21.19/Runtime/ResourceManager/Util/DelayedActionManager.cs:162)
User avatar
Joel
Moodkie Staff
Posts: 4852
Joined: Wed Nov 07, 2012 10:32 pm

Re: UnauthorizedAccessException on .tmp file?

Post by Joel »

Hi there,

As we can't officially support Switch because they do not provide Asset Store publishers with the middleware license legally required to do so, I'm afraid I can't provide support with anything Switch-specific.

However, if you show me the code you're using and a screenshot of your settings I can see if there's anything obviously wrong. If you've changed settings I recommend setting them all back to default.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
cjygame
Posts: 5
Joined: Fri Dec 03, 2021 2:01 am

Re: UnauthorizedAccessException on .tmp file?

Post by cjygame »

I resolved the issue I was experiencing. I simply deleted the whole project and re-cloned another one. But notably, while I was doing that, I noticed that ES3GLOBAL_DISABLED was missing from the Scripting Define Symbols. Apparently, setting your Unity Editor with the Switch add-on inexplicably changes that. So when I was cloning the project again, I made sure to copy down and redefine the scripting define symbols for the cloned project.

I don't know whether it was some sort of corruption inside the code or this Scripting Define Symbol issue, but the error I was seeing is not happening again. Apologies for the trouble, and have a good day.
User avatar
Joel
Moodkie Staff
Posts: 4852
Joined: Wed Nov 07, 2012 10:32 pm

Re: UnauthorizedAccessException on .tmp file?

Post by Joel »

Glad you managed to resolve your issue. Just to clarify, disabling global references (i.e. enabling that scripting define) is unrelated to storage, so wouldn't be capable of triggering the error you were receiving.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply