C
C#2w ago
Staynk

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.
No description
5 Replies
Buddy
Buddy2w ago
Please don't follow tutorials blindly $helloworld
Buddy
Buddy2w ago
And your issue is this $static
MODiX
MODiX2w ago
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/static
Malo
Malo4d ago
You cant call a non static method in a static context

Did you find this page helpful?