Exploring delegates : code error MethodName does not exist in current context | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Exploring delegates : code error MethodName does not exist in current context

To learn more. I am trying to make a delegate. In the code below https://code.sololearn.com/c5oXNAt6pEM3 When I compile the code. The compiler give this error message ..\Playground\(23,62): error CS0103: The name 'MethodHelloWord' does not exist in the current context The method is there, but the compiler does not know about it. What am I doing wrong ?

5th Feb 2018, 8:36 PM
sneeze
sneeze - avatar
3 Answers
+ 1
It's just a simple typo. You have 'HelloWord' instead of 'HelloWorld'. Fix the spelling mistake and it should work fine.
5th Feb 2018, 10:49 PM
Bagshot
Bagshot - avatar
+ 2
Thanks man. Fixed the typo and it worked.
5th Feb 2018, 10:52 PM
sneeze
sneeze - avatar
+ 1
No problem. I've been in similar situations myself, sometimes all it takes is a fresh pair of eyes.
5th Feb 2018, 10:59 PM
Bagshot
Bagshot - avatar