VeriorPies / ParrelSync

(Unity3D) Test multiplayer without building
MIT License
4.77k stars 328 forks source link

[BUG] FileNotFoundException - path may be too long? (265 characters) #90

Closed CodeSmile-0000011110110111 closed 1 year ago

CodeSmile-0000011110110111 commented 2 years ago

I get a FileNotFoundException when trying to create a clone, after which Unity keeps showing the "Hold on" progress dialog forever, even though the editor itself remains responsive. The cloned folder remains empty.

The file in question is at this path, it is 265 chars in total:

C:\Users\Eedee F\UnityProjects\_Netcode\CodeSmile for Netcode 2020.3\Library\PackageCache\com.unity.collections@1.2.4\Unity.Collections.LowLevel.ILSupport\source~\Unity.Collections.LowLevel.ILSupport.CodeGen\Unity.Collections.LowLevel.ILSupport.CodeGen.asmdef.meta

Relevant part of stacktrace:

FileNotFoundException: Could not find file 'C:\Users\Eedee F\UnityProjects\_Netcode\CodeSmile for Netcode 2020.3\Library\PackageCache\com.unity.collections@1.2.4\Unity.Collections.LowLevel.ILSupport\source~\Unity.Collections.LowLevel.ILSupport.CodeGen\Unity.Collections.LowLevel.ILSupport.CodeGen.asmdef.meta'.
System.IO.__Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.FileInfo.get_Length () (at <695d1cc93cca45069c528c15c9fdd749>:0)
(wrapper remoting-invoke-with-check) System.IO.FileInfo.get_Length()
ParrelSync.ClonesManager+<>c.<GetDirectorySize>b__28_0 (System.IO.FileInfo file) (at Library/PackageCache/com.veriorpies.parrelsync@f454248221/Editor/ClonesManager.cs:599)

Enviroment (please complete the following information):

Note: This may be related to the other FileNotFound exception issue but I decided to make a new one because I couldn't tell for sure whether it is the same issue. See: https://github.com/VeriorPies/ParrelSync/issues/86

CodeSmile-0000011110110111 commented 2 years ago

I shortened the project folder to 'CSN20.3' - now I can successfully clone.

Did a little digging, here's some info on how you might potentially enable long paths support: https://stackoverflow.com/questions/5188527/how-to-deal-with-files-with-a-name-longer-than-259-characters

Hopefully that is possible without too much work. ;)

314pies commented 1 year ago

Yes, this is a known issue for windows. (Please refer to the F&Q and Trouble shooting page)