Method not found, despite compiling fine - C#