Im getting an error code when trying to call a method.
I am following a youtube guide please explain what I am doing wrong because his code looks just like mine.

5 Replies
Please don't follow tutorials blindly
$helloworld
And your issue is this $static
In C#, static allows you to have members (classes, methods, etc) that are not tied to any particular instance and are therefore always, globally, accessible. When applying
static
members, take the following considerations:
• If there are to be multiple instances of a class, do not use static
• If you need to track state, do not use static
• If you are going to have multi threaded workflows, do not use static unless you're aware of the caveats
static
is best used for stateless methods, extension methods/classes and in areas where you understand the pros/cons. Read more here: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/staticYou cant call a non static method in a static context