Preprocessor directives must appear as the first non-whitespace character on a line
Here are some solutions collected.
protected void #btnLogin_Click(object sender, EventArgs e)
{
}
But in C# cs files, as the error explains preprocessor directives (#
) must appear as the first non-whitespace character that's why the error happens.
Solution would be to adhere to proper naming conventions. See here.
2.
Preprocessor directives start with #
. You have a trailing #
in line 10.
It looks like you use Visual Studio which should mark the line in red. Also the error should tell you which line looks wrong.
Edit: You probably just opened the file in Visual Studio, which will not load any assemblies. Please open your C# project from Unity, right-click in the project explorer and choose "open C# project" or similar
Honestly this post should be removed for low effort, a simple Google search with your error would've yielded tons of results
3.
I fixed it by removing this line
Comments
Post a Comment