Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice

Bug Error: The process cannot access the file because it is being used by another process.

Discussion in '2022.1 Beta' started by mishakozlov74, Sep 24, 2021.

  1. mishakozlov74

    mishakozlov74

    Joined:
    Aug 8, 2018
    Posts:
    110
    From time to time, after building scripts I get this error. I didn't have it before, probably it's this related to this alpha?

    upload_2021-9-24_19-17-31.png

    If you want me to provide any additional information, just let me know.
     
  2. mishakozlov74

    mishakozlov74

    Joined:
    Aug 8, 2018
    Posts:
    110
    I have to mention that this error cannot be "cleared", I have to restart the editor every time it occurs.
     
  3. RippStudwell

    RippStudwell

    Joined:
    May 16, 2017
    Posts:
    3
    I also frequently experience this problem in Unity 2020.3.3f1 using Visual Studio 2019. The file that becomes locked is seemingly random and when I do a powershell search for processes locking the file- Unity is the only process shown. So probably a thread or child process that didn't properly release its' lock I'd guess.

    The only fix is to restart Unity. Happens multiple times a day. 10-15 min to re-open Unity each time. Wild.
     
  4. mishakozlov74

    mishakozlov74

    Joined:
    Aug 8, 2018
    Posts:
    110
    Yep. Do you use burst?
     
  5. runner78

    runner78

    Joined:
    Mar 14, 2015
    Posts:
    566
    I had similar problems outside of unity. This can often also be done with windows indexer lock files.
     
    mishakozlov74 likes this.
  6. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,554
    this can be anything that checks that same file: Dropbox, antivirus, windows indexer... anything that woud check the file for changes basically.
     
    mishakozlov74 likes this.
  7. scorpioservo

    scorpioservo

    Joined:
    Jul 24, 2020
    Posts:
    8
    Getting the same issue on 2020.3.26. I suspect it might have something to do with Plastic? Since that is checking for file changes.
     
  8. Crawdad

    Crawdad

    Joined:
    Nov 23, 2016
    Posts:
    132
    I am having the same issue. Also using burst. Using 2021.2.9f1.
     
  9. sheredom

    sheredom

    Unity Technologies

    Joined:
    Jul 15, 2019
    Posts:
    272
    LeonhardP and Crawdad like this.
  10. Yehiawld

    Yehiawld

    Joined:
    Jun 11, 2020
    Posts:
    21
    Burst version 1.7.0-pre.1 solved this issue!
     
    RossRH, LeonhardP and sheredom like this.
  11. veeratheveera

    veeratheveera

    Joined:
    Feb 20, 2018
    Posts:
    2
    very simple delete the meta file of the script file
     
unityunity