MinaPecheux/UnityTutorials-RTS

DirectoryNotFoundException: Could not find a part of the path

HDNua opened this issue · 2 comments

HDNua commented

image

I downloaded this project to run it for test. But I've failed to open it.
It yields an error like below. I installed Unity 2020.3.18f1 to match with the version that you've uploaded but it still fails.

DirectoryNotFoundException: Could not find a part of the path 'C:\Users\handy\AppData\LocalLow\minapecheux\RTSTutorial\Data_Dev\Games'.
System.IO.__Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.FileSystemEnumerableIterator1[TSource].HandleError (System.Int32 hr, System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0) System.IO.FileSystemEnumerableIterator1[TSource].CommonInit () (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.FileSystemEnumerableIterator1[TSource]..ctor (System.String path, System.String originalUserPath, System.String searchPattern, System.IO.SearchOption searchOption, System.IO.SearchResultHandler1[TSource] resultHandler, System.Boolean checkHost) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.FileSystemEnumerableFactory.CreateFileNameIterator (System.String path, System.String originalUserPath, System.String searchPattern, System.Boolean includeFiles, System.Boolean includeDirs, System.IO.SearchOption searchOption, System.Boolean checkHost) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.Directory.InternalGetFileDirectoryNames (System.String path, System.String userPathOriginal, System.String searchPattern, System.Boolean includeFiles, System.Boolean includeDirs, System.IO.SearchOption searchOption, System.Boolean checkHost) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.Directory.InternalGetDirectories (System.String path, System.String searchPattern, System.IO.SearchOption searchOption) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.Directory.GetDirectories (System.String path) (at <695d1cc93cca45069c528c15c9fdd749>:0)
DataHandler.GetGamesList () (at Assets/Scripts/Tools/DataHandler.cs:196)
MainMenuManager._PopulateLoadsList () (at Assets/Scripts/Managers/MainMenuManager.cs:250)
MainMenuManager.Start () (at Assets/Scripts/Managers/MainMenuManager.cs:48)

Can you let me know how I can fix this?
Is there someone who has in same situation with me?

Thanks.

Nice catch! Hopefully the commit f249af7 will fix it...
Could you please try to re-pull and tell me if it works?

Thanks! :)

@HDNua your technique works too but I preferred to return a null and cancel the load if it happens (see 18fee13).

Anyway: big thanks for your interest and help with the project, this was a nasty bug but an easy fix! ^^
I'm closing the issue now. Feel free to re-open another if you still have problems with this or anything else ;)
Cheers :)