Copying assembly from 'Temp/UnityEngine.TestRunner.dll' to 'Library/ScriptAssemblies/UnityEngine.TestRunner.dll' failed - corrupting all my projects, tried all other q answers

A few days ago I switched from editing a script in Visual Studio back to Unity (2019.2.10), using HDRP which crashed Unity - when I opened the project again, only a few items in my scene were visible at all, with pink error materials, most items were not visible in the scene and all references to any scripts showed missing script / not monobehaviour.

In the console, I have these two errors:

Copying assembly from ‘Temp/UnityEngine.UI.dll’ to ‘Library/ScriptAssemblies/UnityEngine.UI.dll’ failed

Copying assembly from ‘Temp/UnityEngine.TestRunner.dll’ to ‘Library/ScriptAssemblies/UnityEngine.TestRunner.dll’ failed

I tried reinstalling unity, installing a newer version (unity 2019.2.10 to 2019.2.11, also tried with latest Beta) and have same issue and errors with the project folder. I have a backup folder from a week ago, which when I open it on the same PC results in the same error - I also see that the \Library\ScriptAssemblies folder becomes empty after being opened in unity on this PC. I’ve tried copy pasting everything from that folder back in after opening, no change.

I opened the backup folder on a different PC with 2019.2.11 and was able to open it as normal - however the folder that appears to have been corrupted on the other PC results in the same issue on either PC.

It appears that opening any of my projects (pre-crash and post-crash) results in them being irretrievably corrupted on my main desktop - my other laptop can run a pre-crash project no problem, but that laptop is not good enough to run VR, so I can’t use it for developing this project.

I’ve tried all of the fixes provided by other users here: Nothing works at all:

  • I have already uninstalled and deleted both versions of Unity, deleted everything unity or unity technlogies in my AppData folder, also deleted a ton of keys under unity or unity technlogies in registry.
  • tried reimporting all assets, resetting packages to default
  • I have also tried disabling antivirus, scanning for viruses, (found a bit miner but still having same problem)
  • ensuring I have full admin control of the folders in my project
  • deleting temp folders
  • starting a new project and importing a custom package that I exported which included most of the assets in my project, (scripts, scene, models, prefabs)- importing the asset package causes the same issue (on my desktop, not on my laptop.)
  • opening visual studio and editing a script then going back to unity, no change.
  • I’m not using collaborate or multiplayer package.
  • The problem never goes away by restarting unity
  • List item

My next option is to reinstall windows, but as I seem to have removed unity fully already I don’t know will this definitely fix things - if anyone has any other solutions please help!
I have filed a bug report also.

I had the same problem and found in regedit.exe that some malware wrote a script in to a key called “auto run” in HKEY_current_user/software/microsoft/command processor.
by clearing the key’s data it fixed it for me.
Hope this helps :),I had the same problem and found that some malware wrote in to a registry key called auto run in HKEY_current_user/software/microsoft/command processor, which needs to be empty for the most users.
Clearing that up helped me.
Hope this helped :slight_smile:

I had this same problem yesterday and happily fixed it after copying the Temp/UnityEngine.TestRunner.dll file manually to the folder Library/ScriptAssemblies, which did not have the dll in there for some reason. After that all the errors went away for me. Hopefully this helps anyone out there. Good luck.

I tried this & when I shut my computer off & back on, it won’t start up. Any clues on how to fix this??,I tried this & restarting my computer but now it won’t start back up. Any clues on what I can do to fix this??

Updating preview packages for Screen Capture fixed this for me.

@johnG0709er your solutions works for me.
i had problem in all unity versions in my system.
i install malware bytes and use trail version.
scan then delete issues.
final step restart.
everything works.
Thanks Man you saved my day for reinstalling windows.

An infinite import loop has been detected. The following Assets were imported multiple times, but no changes to them have been detected. Please check if any custom code is trying to import them.
please someone help me to get out of this . i have started a new project in that just if i add burst package or post processing then i am getting the above mentioned error