Getting missing references for no reason

Dont know why i am suddenly getting errors in visual studio saying i have no references for many classes, Unity doesnt give any error and everything works fine but in visual studio i cannot find the methods of the classes as for visual studio dont exist, some of which dont exist for visual studio are UnityEngine.UI, UnityEngine.XR and UnityEngine.InputSystem. I have those installed in Unity and the app works fine when i press play
The only thing i did was creating a assembly in unity and then delete

And then delete what?

the assembly definition

And what happens if you restore the assembly definition?

I am already using a backup i had

This bug is really absurd, i made a backup of the project with errors just in case... and then i realized i could replace the project files with the ones of the backup, i did so and worked. I had the project backup in other hard drive, then i copied this project to the other hard drive and when i tried to open with unity didnt work, had the same missing references. Then i put the project inside another folder and then it worked, somehow didnt work just in the specific folder path i had when started to fail