That usually happens when your class name and file name don’t match exactly. When you first create a C# file and you rename it, it’ll change the class name to match your file name, but if you decide to change that file name afterward it won’t update the class name. More than likely the class name needs to be updated.