Error CS2012: Cannot open file for writing, user-mapped section open. (Unity wont work at all now)

The entre error is this:
error CS2012: Cannot open ‘file path *CurrentUnityProject*\Library\Bee\artifacts\1900b0aE.dag\Assembly-CSharp.dll’ for writing – ‘The requested operation cannot be performed on a file with a user-mapped section open. : ‘file path *CurrentUnityProject*\Library\Bee\artifacts\1900b0aE.dag\Assembly-CSharp.dll’’

Ive done some general research but have come up with nothing.

Im making a game with a friend, we are at the very beginnings, only have a basic Relay server with some player movement working. One day unity decides to give me that error out of nowhere. I naturally look into it, says its likely that the file is open elsewhere. I dont know how thats possible, but I look around, download some file explorer things, its not open anywhere else.

I delete and reinstall VS, doesnt work.
I upgrade AND downgrade Unity, doesnt work.
I reinstall Unity, doesnt work.
I delete all instances (and save my stuff on a flashdrive), and reinstall, update, BOTH Unity and VS. Nope.

While errors happen occasionally, this one is especially odd since a complete reinstall doesnt fix it. The only thing I did beforehand was: The day before, I moved some code out of the project in a weird way, (long story). Right before it happened, I added a spot light to the player prefab as a flashlight. After that, the error, then Unity just stopped doing anything.

If I open a blank project, open a new script, and in Start type “//wheee”, I get the error to the same file path, but for each open project.

Ive been losing my mind over this, any help is appreciated!

Do you have the project in a cloud synched folder? If so: cloud sync (any kind of) is not compatible with Unity projects, can even corrupt the project.

Check if you get the same issues if you create a new project under your user’s Documents folder. If not, this would indicate that the project path has incorrect permissions.

Also if you run any security software (virus scanners), exclude the project path or disable the scanner temporarily.

Theres been a lot of talk of this and turning off av has helped a lot of people, so it is something you would need to configure your av to perhaps ignore your dev folder

@CodeSmile @bugfinders The project is only with the Unity cloud (so its built in), so I assume thats not a problem. New projects crash if i add so much as an empty script with a “//wheee”.

If I put it under a new place, the same thing occurs.

I have webroot, and disabling DID fix the problem, but I would rather have webroot activated. That being said, I tried to allow a single file through, but I dont know how to allow a file path. Help would be appreciated!

in what way is it with unity cloud? its also on your hard disk, that compile sounds local, so ive seen other threads with webroot (never heard of it before this week) and they all said turning it off made it work, so if theres like c:\users\me\Documents\Unity as your core root projects, you need to find a way to exclude that for your sanity

@bugfinders it is a multiplayer game, so its connected with some of the unity hosting services. Long story short, in Unity Hub, it says its connected to “Unity Cloud Project” (im new to online games so not 100% sure if its just the online services or something)

As far as I know, I cant exclude the entire project, only individual files.

Right but thats for that its not that the whole things in a cloud

as for the antivirus. If you cant exclude folders it sounds unfit for purpose.

I dont think any can exclude folders is most personal plans. Only large business style ones have that access.

Besides, if I turn off the current AV, the project runs fine.

In that case, this is absolutely NOT a Unity problem.

Stop the AV from running where Unity is or get a new development machine where you can do so.

If it helps you reason about the problem, just pretend in your mind that when Unity opens project X, it literally opens EVERY SINGLE FILE in some kind of shared memory mapped architecture or other, and that is why nobody else can be touching it. I’m sure it’s not quite like that, but the subjective experience is the same: no file access.

The issue is, I cant seem to find a way to have the AV ignore it. It can ignore individual files… but that seems to be it. Single files. I had it ignore Unity as well as the file that started it all, but nothing. I cant find VS to ignore that, but another forum I (and i think you) are a part of said that it didnt work anyway.

i googled your crappy av

their response was you dont need to exclude stuff contact us if its causing an issue

Or do the sensible thing and buy an av you can control :slight_smile: