This error seems to pop up every time I change code in Entities.ForEach. Restarting the editor fixes the problem, but it’s very annoying because I can’t go into play mode without restarting.
Script updater for Library\Bee\artifacts\1900b0aE.dag\Assembly-CSharp-Editor.dll failed with exitcode -532462766 and stdout: Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\xxx\myProject\Unity[^\]+(\.ref)?\.dll
.
at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
at System.IO.StreamReader…ctor(String path)
at ScriptUpdater.Program.<>c__DisplayClass8_0.b__0()
at ScriptUpdater.Program.Profile[T](Func`1 toProfile, Int64& elapsedTime)
at ScriptUpdater.Program.Main(String args)
— End of inner exception stack trace —
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object parameters)
at Program.Main(String args)
I believe there was, perhaps still is, a problem if the project path contains a space character. Does the path to this project contain a space? Can you try to rename, in case it does and check if it makes a difference?
My project has no spaces or special chars in the path. But my unity installation does, there used to be an error with that that they fixed in a9. But the fix might not be complete so I’ll try to move the unity installation again see if that fixes it.
Im getting similar trying to make a build in 2021, but it says access denied, no spaces. And notice its “Bee” same dir:
Script updater for Library\Bee\artifacts\1900b0aP.dag\Assembly-CSharp.dll failed with exitcode -532462766 and stdout: Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
—> System.UnauthorizedAccessException: Access to the path ‘I:\2020upg\gd22\Temp\ScriptUpdater\1276223543’ is denied.
at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
at System.IO.StreamReader…ctor(String path)
at ScriptUpdater.Program.<>c__DisplayClass8_0.b__0()
at ScriptUpdater.Program.Profile[T](Func`1 toProfile, Int64& elapsedTime)
at ScriptUpdater.Program.Main(String[ ] args)
— End of inner exception stack trace —
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[ ] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[ ] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[ ] parameters)
at Program.Main(String[ ] args)
EDIT: right clicked on bee changed from read only, worked.
Removing the read-only check on the bee folder also seems to have worked for me. I was getting the bee compile error every other compile, which was maddening. Thanks @radiantboy
I encountered this in Unity 2021.1.1f1, the installation of Unity was at C:\Program Files\2021.1.1f1-XXX (where XXX is a custom Unity build for a certain platform) and was getting the error as the original poster.
Also like the original poster, moving my Unity installation to a path without a space fixed the issue to C:\Unity\2021.1.1f1-XXX
My permissiosn issue is annoying as it seems to get set ack to read only constantly, and often I need to kill unity, very bloody awful. It basically makes unity unusable, weird how it worked for a few days.
Same exact problem here. I’m betting the new intern in the Installer Division flipped a switch they shouldn’t have on the 2021.1.1f1 build, and here we are… …waiting for 2021.1.1f2
Unfortunately moving my project folder to C:\Unity\ didn’t solve the issue…
I’m getting the DirectoryNotFoundException on it :
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Unity\xxx\Unity[^\]+(\.ref)?\.dll
I have several versions of Unity installed, so if I have to move the actual install, is there a simple way to move an install to somewhere else and have Unity Hub recognize it ? Because I find Unity Hub to be too rigid when it comes to where the installs are (they can’t be scattered to different places)…
EDIT : Ok with a little bit of searching I found the option to move the default editor install folder, I’ll install a version there and tell you how it goes.
EDIT2 : It worked indeed. The error used to appear whenever Unity recompiled the scripts so every time I made a change to my scripts and went back to Unity it threw the error and couldn’t hit Play. Had to close Unity and start it again to test my changes. It didn’t do it this time so I guess that’s a fix. Thanks guys !.
I have several versions of Unity installed, so if I have to move the actual install, is there a simple way to move an install to somewhere else and have Unity Hub recognize it ? Because I find Unity Hub to be too rigid when it comes to where the installs are (they can't be scattered to different places)...
EDIT : Ok with a little bit of searching I found the option to move the default editor install folder, I'll install a version there and tell you how it goes.
EDIT2 : It worked indeed. The error used to appear whenever Unity recompiled the scripts so every time I made a change to my scripts and went back to Unity it threw the error and couldn't hit Play. Had to close Unity and start it again to test my changes. It didn't do it this time so I guess that's a fix. Thanks guys !
yeh you can just click locate to specify new path in hub for an install (I have many scattered around). Thankfully my issues with this seem to be over due to project being on c: I was able to make a build woo!.. My actual unity install is on D: which is a normal HD. Im not sure there is any real benefit of installs of unity on an ssd, but yeh make sure path has no spaces or special characters.
Can confirm this. Changing install directory to one without spaces fixes it. On 2021.1.1f1 - how did this get through? Wasn’t happening on previous versions.
Thanks @LeonhardP ! it just came back today!! even on my c: drive, very glad that it is being fixed, I cant even un the game. I will test tonight seems that version is out now, I hope it also fixes permission denied error :
Script updater for Library\Bee\artifacts\1900b0aE.dag\Assembly-CSharp.dll failed with exitcode -532462766 and stdout: Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
—> System.UnauthorizedAccessException: Access to the path ‘C:\gd21\gendolp\Temp\ScriptUpdater\1034605408’ is denied.
at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
at System.IO.StreamReader…ctor(String path)
at ScriptUpdater.Program.<>c__DisplayClass8_0.b__0()
at ScriptUpdater.Program.Profile[T](Func`1 toProfile, Int64& elapsedTime)
at ScriptUpdater.Program.Main(String[ ] args)
— End of inner exception stack trace —
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[ ] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[ ] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[ ] parameters)
at Program.Main(String[ ] args)
Seems to be fixed so far! thanks! only weird thing about new unity is that saved by batching is almost always very low like 0, maybe 4, im sure this value used to be huge, did something change in the way its reported?