Search Unity

[SOLVED] Copying assembly 'Temp/Assembly-CSharp.dll' failed

Discussion in 'Editor & General Support' started by jzzja, Sep 9, 2018.

  1. jzzja

    jzzja

    Joined:
    Sep 28, 2017
    Posts:
    43
    When I make changes to a script in mono develop and then switch to Unity very often this error is shown in the console and I am unable to run the project in the Unity editor.

    Copying assembly from 'Temp/Assembly-CSharp.dll' to 'Library/ScriptAssemblies/Assembly-CSharp.dll' failed


    I'm on version 2018.2.6f1 but I also had this problem on the previous version. This only started happening recently. I've read of other people having this issue. Closing Unity and reopening seems to work but as the error happens very often this isn't ideal.

    Any advice on how to fix this is appreciated. Thanks.
     
    Last edited: Sep 9, 2018
  2. Manaaja

    Manaaja

    Joined:
    Dec 1, 2016
    Posts:
    1
    Edit: It was just Kaspersky screwing things up.
     
    Jewel98, Nefisto and Bananozuar like this.
  3. jzzja

    jzzja

    Joined:
    Sep 28, 2017
    Posts:
    43
    Thanks, I also use Kaspersky. I've now added my project file as an exclusion in Kaspersky.
     
  4. jzzja

    jzzja

    Joined:
    Sep 28, 2017
    Posts:
    43
    Can confirm this was caused by Kaspersky. After setting project folder to be excluded I have had no more problems.
     
  5. george_vasilchenko

    george_vasilchenko

    Joined:
    Sep 20, 2014
    Posts:
    14
    Hey guys, I do not have Kasperskiy, instead the basic windows Defender. The issue is happening all the way, every 5 minutes. Any other ideas??
     
    LuLusg and DDmeow like this.
  6. jzzja

    jzzja

    Joined:
    Sep 28, 2017
    Posts:
    43
    Try adding your project folder as an exclusion - link
     
  7. adarshabn

    adarshabn

    Joined:
    Sep 7, 2018
    Posts:
    5
    mine error is still their , what to do guys?
     
  8. MarsZhan

    MarsZhan

    Joined:
    Apr 22, 2015
    Posts:
    2
    Reimport you script file, can fix !
     
    LuLusg, Circool, NarutoU21 and 4 others like this.
  9. fcastro_unity

    fcastro_unity

    Joined:
    Sep 11, 2018
    Posts:
    1
    @jzzja ... If I had a penny... for every time I needed to close up and open it up my unity projects... ladies... I would be reach. But yes this time it worked

    Copying assembly from 'Temp/Assembly-CSharp.dll' to 'Library/ScriptAssemblies/Assembly-CSharp.dll' failed

    of course after I troubleshoot it for a little while!

    thanks
     
  10. syedhasan1964

    syedhasan1964

    Joined:
    Sep 10, 2018
    Posts:
    1
    The only solution seems to be right-clicking on the script folder and then left clicking on the Reimport menu item.
     
  11. captains

    captains

    Joined:
    May 22, 2017
    Posts:
    1
    [QUOTE = "syedhasan1964, post : 3906463, member : 2007793"] 유일한 해결책은 스크립트 폴더를 마우스 오른쪽 버튼으로 클릭 한 다음 Reimport 메뉴 항목을 왼쪽 클릭하는 것입니다. [/ QUOTE]
    해결됬습니다~ 정말 감사드립니다^^
     
  12. ocimpean

    ocimpean

    Joined:
    Aug 10, 2013
    Posts:
    128
    I restarted Unity and it worked.
     
  13. MercurialKid

    MercurialKid

    Joined:
    Aug 30, 2018
    Posts:
    22
    Yes: restarting Unity works. But this is must be an active bug. Nothing to do with Kaspersky. I get this 5 times daily. V. annoying!
     
  14. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    The same problem 2018.2.13
     
  15. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    176
    yep this is the most annoying error - I get this multiple times a day and most frustrating of all after spending an hour waiting for a build it pops out and ruins the build. Usually on the postprocessing.dll.
    Unity 2018.3.4
     
    CyRaid likes this.
  16. robinspots

    robinspots

    Joined:
    May 10, 2018
    Posts:
    13
    Yep, I also get this daily :(
     
    OctaLuna123 and CyRaid like this.
  17. GameReator

    GameReator

    Joined:
    Apr 2, 2019
    Posts:
    2
    Its the first time i get this.
    and in unity i dont have the fille assembly-csharp.dll
     
  18. Heckmouse

    Heckmouse

    Joined:
    Nov 7, 2014
    Posts:
    27
    This is annoying, the best/fastest solution I've found is to right click any script and re-import it. That way you don't need to reload everything or restart Unity.
     
    donnawang likes this.
  19. unity_LzBuY34i8W2htg

    unity_LzBuY34i8W2htg

    Joined:
    Dec 27, 2017
    Posts:
    9
  20. samra2494

    samra2494

    Joined:
    Nov 23, 2015
    Posts:
    21
    , remove the file
    Library/ScriptAssemblies/com.unity.multiplayer-hlapi.Runtime.dll
    and now build works again, once only. The file-removal procedure has to be repeated for every build
     
  21. cadenstonegreen

    cadenstonegreen

    Joined:
    Jul 15, 2019
    Posts:
    1
    Thanks! Helped a ton!
     
  22. tomasvaitkevicius222

    tomasvaitkevicius222

    Joined:
    Aug 5, 2019
    Posts:
    1
    I saw somewhere on forum that coin miner malware is causing this issue, tried to scan my pc, found 2 miners, deleted them and Unity started working again. I used malwarebytes.
     
  23. OrderOfOut

    OrderOfOut

    Joined:
    Sep 21, 2018
    Posts:
    37
    Not fixed. Happening in 2019.2 and I'm not running any of those security programs.
     
  24. LIt4g0

    LIt4g0

    Joined:
    Aug 13, 2019
    Posts:
    1
    This bug in conjunction with an issue that only lets me boot unity if i do it right after a fresh windows reboot....
     
  25. LecramGB

    LecramGB

    Joined:
    Oct 9, 2018
    Posts:
    2
    FINALLY. I got a lot of Unity errors and this was the cause. Also solved with Malwarebytes. Looks like miners F*** up with the Unity importer... Thanks a lot, I've been having troubles for weeks.
     

    Attached Files:

    BennyCatClaw and tribio like this.
  26. hoangvd1998

    hoangvd1998

    Joined:
    Sep 3, 2019
    Posts:
    1
    I have a question is that active bugs can effect to my project ?, i dont know how to fix the code from the libary download. When i running game, everything just fine.
    So just leave it be ?
     
  27. dhtpdud528

    dhtpdud528

    Joined:
    Apr 8, 2018
    Posts:
    23
    껏다 키면 됩니다.
     
    m0hunna likes this.
  28. Osdon

    Osdon

    Joined:
    Nov 26, 2016
    Posts:
    2
    I've all of the solutions mentioned Above and none seems to solve my problem
     
    travlake likes this.
  29. Lumpazy

    Lumpazy

    Joined:
    Apr 24, 2018
    Posts:
    45
    same problem - repeatedly.
    it may be that the file : /ScriptAssemblies/Assembly-CSharp-firstpass.dll' is still open (or again) in the unity editor when it tries to overwrite it as it compiles.

    usually it looks like the whole directory is deleted and rebuild with the files as unity compiles the project.
    When the error comes up, the file cannot be deleted, ansd therefore also the directory.

    so far this time worked for me :
    i reopened unity.
    then deleted the file.
    unity then complains twice within compilation that it can't create the directory (scriptassemblies) and asks to try again, which works.

    so instead of having to reopen the project every 5 minutes i now just have to press a button twice.

    seems like there is no failsafe and retry in the copy process of the temporary files, but there is one as it creates the directory.

    really didn't dive into this, buit the above worked for me.
     
  30. Lumpazy

    Lumpazy

    Joined:
    Apr 24, 2018
    Posts:
    45
    same here .... last solution worked temporary ....
    This error is a huge waste of time.
     
  31. tribio

    tribio

    Joined:
    Oct 5, 2013
    Posts:
    29
    I've deleted the Library and Temp folder, now the whole project doens't even start anymore!:(
     
    LuLusg likes this.
  32. VoodooDetective

    VoodooDetective

    Joined:
    Oct 11, 2019
    Posts:
    239
    Same problem
     
  33. Am11r

    Am11r

    Joined:
    Nov 22, 2019
    Posts:
    1
    I've got the same problem here...
     
  34. aerospacevitd

    aerospacevitd

    Joined:
    Nov 29, 2017
    Posts:
    5
    None of this fixes are working for us. We've removed almost all the packages and aren't using malwarebytes.
     
  35. carlosdenner

    carlosdenner

    Joined:
    Sep 14, 2019
    Posts:
    1
    same problem with 2019.2.14f1
     
  36. BennyCatClaw

    BennyCatClaw

    Joined:
    Feb 25, 2017
    Posts:
    1
    Holy cow, I could not believe, but this was it for me! I tried tried everything, I was on the verge of tears and Windows reinstall when I tried this out of desperation (I don't trust software I don't know). Malwarebyte actually worked, what surprised me the most is that the free version was enough. I had some 'TrojanBitCoinMiner' malwares...
    THANK YOU!!
     
  37. kebtastic

    kebtastic

    Joined:
    Jan 9, 2018
    Posts:
    2
    Thank You, this solution works perfectly!
     
    DanilProny likes this.
  38. reblig07

    reblig07

    Joined:
    Dec 29, 2019
    Posts:
    1
    Jesus.... Thanks a lot, this resolve my problem, I scan my pc with Malwerebytes and it found 7 that Coin miner, now that I remove the problem is fixed. Thanks a lot
     
  39. NatCou

    NatCou

    Joined:
    Jan 29, 2017
    Posts:
    26
    Thanks worked for me :)
     
    OctaLuna123 likes this.
  40. wolfy2

    wolfy2

    Joined:
    Nov 2, 2015
    Posts:
    13
    Wierdly enough that turned out to be true. Malewarebytes found the miner and problem was resoleved after the quarantine.
     
    Propagant likes this.
  41. mechanicalhorizon

    mechanicalhorizon

    Joined:
    Jan 8, 2017
    Posts:
    2
    I'm having this same issue, but Malwarebytes found nothing on my computer. I then uninstalled Malwarebytes and still had the problem.

    Then I did a fresh, clean install of Unity. I even cleared out all folders and also my Registry of anything dealing with Unity and still have that error.

    I even started a new, clean project and the second the window opened, those two errors appeared.

    So what is causing this problem seems to be totally random, as are the solutions.
     
    Propagant likes this.
  42. travlake

    travlake

    Joined:
    Oct 4, 2019
    Posts:
    50
    For me the problem turned out to be caused by Dropbox, which I had syncing the project folder. Turns out that's a no-no.
     
  43. mretskn

    mretskn

    Joined:
    Mar 8, 2017
    Posts:
    2
    Thank you very much! Malwarebytes resolved the issue.
     
    richardgengle likes this.
  44. brandav

    brandav

    Joined:
    Sep 5, 2016
    Posts:
    7
    Was just going to post this! Can't believe how many months this has been happening to me intermittently and finally noticed the syncing correlation. So frustrating and so glad it's fixed! Just click on the Dropbox icon and Pause Syncing.
     
    samidr8 likes this.
  45. Propagant

    Propagant

    Joined:
    Nov 18, 2013
    Posts:
    38
    Hey guys, same error here! It just popped out of nowhere, now I can't even start a new project. Got this issue for the first time after many many years.

    Copying assembly from 'Temp/UnityEngine.TestRunner.dll' to 'Library/ScriptAssemblies/UnityEngine.TestRunner.dll' failed
    Copying assembly from 'Temp/UnityEngine.UI.dll' to 'Library/ScriptAssemblies/UnityEngine.UI.dll' failed


    I always get these two errors when I import something to the completely blank project. I also tried to clean my pc with antivirus, but nothing happened. I do not use any sync software as mentioned above, so it looks like something is missing or some files might be locked as there is stated it can't copy assembly files from temp to ScriptAssemblies? Any solution? Thanks!
     
    Last edited: Mar 29, 2020
    Deleted User likes this.
  46. Deleted User

    Deleted User

    Guest

    Same problem (2019.3.7f1)... I have tried reinstalling Enigne = didn't work; than reinstalling Hub = didn't work;
    No antivirus problem and even other versions of unity engine 2020 beta and 2018 don't work.
     
    Propagant likes this.
  47. Propagant

    Propagant

    Joined:
    Nov 18, 2013
    Posts:
    38
  48. nostramus_avitae

    nostramus_avitae

    Joined:
    Jun 17, 2019
    Posts:
    3
    followed the same "solution" as what "clever guy" described and i'm not seeing an "auto key" script in there.
    i'm not sure what's actually causing errors like these to pop up on my end, maybe i need to investigate more of this.

    --- (Update 1) ---

    the "general security" software (with all text of it written in Simplified Chinese i think, so it's Chinese software basically) was on all the time and was blocking Unity's access to copy one file to the other. which is why these errors suddenly disappeared on my end.

    i have no hard feeling against such software but i had the software simply quit running in a normal way. (i couldn't understand Chinese) i can't really explain how i did it, it's a long story but what i will say is it's not that complicated and does not require Task Manager.
     
    Last edited: Apr 16, 2020
  49. alstovbur

    alstovbur

    Joined:
    Apr 16, 2020
    Posts:
    2
    I had the same problem. Tried everything. Finally, I checked PC by Malwarebytes, it found 4 miners and a problem was fixed!
     
  50. ddixonwilliam765

    ddixonwilliam765

    Joined:
    May 2, 2020
    Posts:
    1
    I just had the same error today!!!! on the new unity version!