Why is this happening to my editor?

I keep getting these errors every time I open Unity, it won’t let me play or build my game and it messes up the URP and HDRP materials upon re opening the project.

mind you both of the errors show NO information except for that visual c# compiler message

also, upon searching the editor logs I found these lines:

-----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/UnityEngine.UI.dll
Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
Copyright (C) Microsoft Corporation. All rights reserved.

-----CompilerOutput:-stderr----------
The system cannot find the path specified.
-----EndCompilerOutput---------------
- Finished script compilation in 1.884409 seconds
Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
Copyright (C) Microsoft Corporation. All rights reserved.

which I think has something to do with it


I’ve tried reinstalling unity, reinstalling visual studio, deleting everything related to unity (hub, registry keys, etc) off my computer and reinstalling, but to no avail.

If anyone has any suggestions that would be very helpful

Thanks in advance!

I’m getting the exact same thing. Ever find a solution?

Did some digging, found a similar error on a forum. The idea is that visual studio, for some reason, has trouble showing a particular compilation error from your project. So one way to solve it would be to look in your project and delete chunks of it until the error goes away, then you can add the pieces back and see exactly which part causes the issue.

Just to be clear, in that case, the error was thrown due to visual studio not being able to show a compilation error right. So there was a simple compilation error that triggered the behavior and by fixing that compilation error, this visual studio crap went away too.