This only happens when I launch a new project from Unity Hub on Windows. If I launch Unity directly new scripts are fine. It is also fine on my mac whether launching from Unity Hub or otherwise.
These are brand new scripts created by right clicking in the assets window and selecting create → C# script. Before opening them or editing them in anyway the Inspector give the message “No Monobehaviour scripts in the file, or their names do not match the file name.” When trying to drag and drop onto an object I get the “Can’t add script” message. The file name of the script absolutely matches the class within the script.
Tried changing the External Script Editor in preferences and changing back as well.
Tried reinstalling Unity Hub
Tried Installing new Unity version packages in Unity hub.
I’ve searched for solutions and tried all I can to no avail.
Any help appreciated.