Why do all of my scripts say "No MonoBehavior scripts in the file, or their names do not match the file name?"

In my project, I had a bunch of C# scripts that were working pretty well. Then, I created one new one, without editing it, and tried to attach it to an object. All of the sudden, every single C# script wouldn’t connect to any game object, and above every script it said, “No MonoBehavior scripts in the file, or their names do not match the file name.”

I am so frustrated, and have gone to many different threads, looking for how to fix this, but none of their solutions worked for me. What is happening?

This sometimes happens. You can reimport all your scripts, if restarting unity as admin(if windows) doesn’t work.