Error when changing Scripts

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?

3 Likes

Thanks for the hint.

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.

Moving the install helped.

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.

1 Like

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

2 Likes

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

1 Like

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

(and flipping the read-only bit on Bee)

1 Like

Yes it has halted my dev altogether, im trying to copy back to c: I feel somehow it will work there.

EDIT: moving to my c: ssd solved it, so far so good, tough to afford the space though.

1 Like

Yep same for me. Really annoying and halted my dev too.

1 Like

Try moving project to c: works for me so far. Before I was using external usb ssd for a while it seems to cause issues.

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.

1 Like

Hi everybody,

This issue should be fixed as of 2021.1.2f1. It is being tracked here: Unity Issue Tracker - API Updater fails with &#39;System.IO.DirectoryNotFoundException: Could not find a part of the path&#39; exception

2 Likes

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)

1 Like

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?

Using 2021.1.19f1 and still have a similar error.

Script updater for Library\Bee\artifacts\1300b0aEDbg.dag\Assembly-CSharp.dll failed to produce updates.txt file

Strange, I have some Bee assets. Is something related to the name Bee?

1 Like

Seems to be back in 2021.2.0b11.
I already tried changing the directory, still same issue, any alternatives ?