No MonoBehaviuor

Hello guys,
maybe it is not the right place to put this question, but i am new so forgive me, I encounter this error:

i just create a new UNITY project (ver. 2019.2.17f1)
then i create a new C# script in Assets window keeping it with the default name “NewBehaviourScript”

well it comes with already an error: “No MonoBehaviour scripts in the file, or name not match filename” (second option obvously not the case)

Do I have to import any package or some extra Assets to include all the dependencies and ged able to get MonoBehaviour?

Thank you very much

PS my PC language is french so i dont know if something is connected to this.

Post the contents of the file.

Are you using a Windows pc or Mac or Linux? On Mac or Linux, you may need packages.

Ok i thought the content of file was ininfluent cause it is the automated one created by unity…
My system spec are: Windows 7 SP1 - 64bit CPU AMD AThlon 3.40 Ghz - 6Gb memory
i just create a new UNITY project (ver. 2019.2.17f1) from UNITY Hub 3D template after opening UNITY i right click on Assets and create C# script and this is what is automatically created (imported object: NewBehaviourScript )

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NewBehaviourScript : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{ }
// Update is called once per frame
void Update()
{ }
}

Hope this helps, Thank you very much

What IDE are you using? Is it up to date? Do you still have the problem if you quit Unity, restart it and reload your project?

What IDE i do use is it important? I am just creating a script in unity interface… anyway it downloaded and installed visual studio 2019, and yes i restarted PC and tried creating new project or reloading the new saved with no results, i am now trying to install a older version of unity maybe it will change something…

I created a script exactly like you did in 2019.2.17f1: no problem so, yes, anything can be important.

If nobody can reproduce your problem, nobody will be able to help and we’ll have to “fish” until we find what the problem is.

Did you search the web about that error? https://duckduckgo.com/?q=No+MonoBehaviour+scripts+in+the+file%2C+or+name+not+match+filename&t=ffsb&ia=web

Man, I didn’t mean disrespect or complain, sorry to sound like that. And yes i read that page you linked there.
I am sure it is about Visual Studio settings or installation because i just installed UNITY and creating an empty C# Asset it was the first thing i have done in it…
I notice that VisualStudio has been installed in french

installed Unity 2018.4.14f1 (64-bit) with VisualStudio 2018 same result.

Thanks to help me understand that the message I get in UNITY interface about the script error is coming from the IDE and not UNITY itself.

Still searching.

Game Development with Unity must be installed in Visual Studio; it should have been installed already if you installed Visual Studio Community by adding the module in the Hub. The language you use is irrelevant.

5350011--540330--Capture.JPG

Yes it is installed

Bottom line: delete the script and create a new one, change its name this time.

Edit: just in case, make sure Windows is up to date and restart your computer.