In order to solve this error, don't change the name of the .cs file when creating new code.
If you want a new name for your .cs file then you have to delete everything in the folder where your project is i.e., the fragments of files (bin, obj folders, etc.).