Wednesday, July 4, 2012

C# Method Calls & Variable Scope

Above my C# "public class" code line I wrote "Using System";


I received DOS Compiler Error CS0116, so I went to the Microsoft website to receive help at the MSDN, developer library.


Compiler Error CS0116 = "A namespace does not directly contain members such as fields or methods." Inside a namespace, the compiler only accepts classes, structs, unions, enums, interfaces, and delegates. 


MSDN answer, highlighted in red, does not help, and is confusing and useless.


Compiler Error CS0116 = Don't capitalize "Using."


This answer, highlighted blue, was what they should have said.

No comments:

Post a Comment