I have had recurring issue where, if I start running the project in the editor, I will get the error shown below. It often won’t come up at first, but after some time spent working it will come up again, often multiple times. I did some research on sharing violations and how others tend to fix them, but all of the examples I found were users fixing their own code. But the json file associated with this error is generated by unity, I have ever opened or interacted with directly. I am also doing this project on a local computer so it seems very unlikely that I am trying to edit a file without permission. Has anyone seen or fixed this problem before?
Close the project, delete the Library folder, and reopen project once deletion is complete. Also exclude the project path from any antivirus you may have installed, including Windows Defender (although that one plays nicely contrary to most other AVs).
Thank you for your advice. I deleted the library folder, disabled my antivirus software (McAfee) and reopened the project. It seems like that may have helped, it took longer to reach this issue than usual, but it still came back eventually. I would rather not make a routine of deleting the library folder since that significantly increases the amount of time it takes for Unity to start up. Is there anything else I can do?
Make sure you exclude the project root from antivirus scans. If that fixes the issue for good perhaps uninstall mcafee entirely, Windows Defender is far less intrusive than 3rd party scanners and just as capable.
I disabled McAfee entirely after your first post, and the error unfortunately still cropped up.
Damn. Any other background tools that may be hooking into filesystem changes? Various other tools also perform some sort of ‚directory monitoring‘ (watching for file system changes) that could interfere.