Having the same issue. Thought that it’s related to debug mode, as PDB files contain application debugging information, but it happens in release mode too. Tried removing Library folder (among others) as this helps in some issues, but the issue persists
This happens on even an empty unity project. Just keep saving an empty c# file and going into the editor over and over and it WILL happen
Very small prototype project, also getting the same error randomly after changing code in the IDE and returning to the editor, using 2021.2.0f1, with Rider 2021.2.2, also using Burst in my project, so perhaps that’s it.
Restarting Unity fixes it until the next time it happens.
I’ve been using Burst as well. I have a single Job that has the BurstCompile attribute so I created a new Assembly definition for that single script file and have not gotten the error once since then. I’m pretty sure that solved it for me.
I noticed that Burst has a 1.7.0-pre.1 update and in the changelog read the following:
I haven’t updated yet since using an Assembly definition has seemed to fix it for now and the update is just a pre-release, but perhaps updating could solve it as well.
I have been getting the same issue for about 3 months…can we please fix this. I get this about 3~4 times a day. I have to restart the editor to get rid of this.
Here is a screenshot
I use Burst and gets the same issue. Perhaps it is Burst… well, I updated burst package to 1.6.2, and I will see if it still happens…
Edit-- Updated Burst, but it still happens…
Can this issue be looked at ASAP ? I know Unity may be waiting for a “bug report” on this, but honestly, I could send my entire project which this happens, but it may not be reproducible at Unity side which makes the whole process so much more painful and not so encouraging.
Not very happy to rage quit Unity almost 5-10 times a day because of this.
I guess you could try the 1.7.0 pre release version of Burst and see if that might help?
Or you could just try making an Assembly definition for all your scripts which use Burst, as I did in my last post. That has completely solved it for me!
That’s a solution as long as you’re not working on Bursted code (or anything they depend on, like changing a shared data type, which would require the Bursted code to be recompiled). If half your codebase (or some important pieces) are Bursted, that’s not much help.
That being said, this is really a design flaw in Windows/NTFS.
Can also confirm that once I commented out all my [BurstCompile]s, I haven’t seen it happen since. Obviously not a great solution…
It also happens in Unity 2022.1a15
Happens to me too. Not using Odin. Restarting “fixes” it for some time.
Library\ScriptAssemblies\Assembly-CSharp.pdb: Copying the file failed: Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird.
It seems recompiling is not an external process (at least a new window pops up?) which sounds like its (more) async now - I like that. But maybe it’s not closing the File correctly?
Hope you fix it though.
Today was really hell for me with this issue. Sometimes only takes 1 or 2 compiles for this lock up to happen and then I have to restart Unity. I have been doing it over and over again for like… literally more than 100 times today. This is really really not good. Sometimes it even happened upon starting Unity when it tries to compile any script changes I made during the start up of the Unity.
Do you use Burst all the time? If not, have you tried disabling Burst Compilation?
We do need burst basically all of the time. Turning it off works around this issue but I would like to keep it on.
I can confirm that this happens in Alpha16 as well.
Sometimes, if I just ignore the warnings and keep working on my script in VS and save/compile, it gets out of it - not all the time. So I ended up closing the editor and making changes to the script. This is the most clean and fast way at the moment.
Please can we fix this ASAP.
In case it helps, I am using a Ryzen 5950x CPU. Just in case this is a AMD/Windows Scheduler thing. If anyone posted above is using Intel, kindly do tell
This looks like such a wide spread issue and we need Unity to reply on this…
Ryzen 9 5900x here. happens on both my work and home PCs, which are also both using the same cpu.
Just adding another data point to the discussion. I’ve been getting this bug since upgrading from 2020.3.8f1 to 2021.2.2f1. I also use Burst.
We just upgraded to 2021.2.4f1 and are seeing this every half hour or so. Waiting 2 minutes, changing a line of code in C#, and then refocusing on Unity seems to work around it. Interestingly enough we had a hang on occasional recompiles in 2021.1.37f before at a similar cadence, so I’m thinking this is now a visible error where before it was a hard freeze.
We are using Odin and Burst extensively. Burst compilation is required.