Compilation errors on every project I create

System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Windows\System32\Library\Bee\artifacts\mvdfrm\Unity.Burst.Cecil.Mdb.dll_F5791B14F366A51E.mvfrm'.
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
   at System.IO.StreamWriter.ValidateArgsAndOpenPath(String path, Boolean append, Encoding encoding, Int32 bufferSize)
   at System.IO.File.CreateText(String path)
   at ApiUpdater.MovedFromOptimizer.Program.RealMain(String[] args)
   at ApiUpdater.MovedFromOptimizer.Program.Main(String[] args)

I get this error (and many variations, all just referencing a different DLL) on every project I create, on every different Unity version.

My project is placed inside of my documents folder, and none of the DLLs that the engine is looking for are in the project folder.

I’m running Windows 11 Pro 24H2 (OS Build 26100.6584), with a Ryzen 9 5900x, RX 580, 32GB DDR4 RAM.

Try that project somewhere else. I use c:\unity or c:\projects in windows systems, or ~/unity on MacOSX

Otherwise, work through the usual google-returned issue, antivirus, etc.

That sounds like there’s something seriously wrong.

This part of the path \Library\Bee\artifacts is usually in your Unity project’s root. Which seems to indicate that the project is either located in C:\Windows\System32 where it definitely should not be (and according to you isn’t) or something got the editor confused into thinking that the working directory of the project is in C:\Windows\System32.

The only thing that I can think of (long shot) is that perhaps the environment variables TEMP or TMP were set to C:\Windows\System32 and Unity is thus trying to save temporary files in a OS folder which requires elevated privileges to write into.

If this happens even in blank projects I would suggest uninstalling all editor versions, then the Hub, then remove any leftover Unity/Hub files under AppData (keep backups just in case). Then disable any 3rd party antivirus (Windows Defender is usually fine with default settings) and reinstall.

If the issue persists it’s probably something wrong with your system. You can either go through great lengths trying to analyze what might be wrong, or reinstall Windows from scratch to reset everything back to defaults.

Environment variables are set correctly, and I fully reinstalled to no avail… oh well. I’ll probably look into other engines for the time being. Thanks anyway!

If you have win11, my documents is not my documents its inside a one drive. Put it elsewhere, like c:\projects.

Ouch, good find!

Rule of thumb: if you want to waste gigabytes of cloud space on temporary files and enjoy the lingering feeling of your project getting catastrophically destroyed at any point in time without any means of recovery, then by all means use cloud sync. Otherwise: don’t! Use source control, or just make regular backups.

Note: a Unity project must be closed when making backups (same for cloud sync) or else the backup will be incomplete or inconsistent!

Forgot to mention that I did try somewhere else, also rest assured that I was not using OneDrive for my documents folder haha.