© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
12 replies
Shunrai

✅ Attempting to create a method throws CS0116?

Brothers, everything was working fine on the previous projects I started. Now for some reason I am getting CS0116 error on my method that I am trying to create and I can't figure out why. Any ideas?

using System;

namespace _08.MathPower
{
    internal class Program
    {
        static void Main(string[] args)
        {

            Console.WriteLine("Hello World!");
        }
    }
    static int OperatorMethod(int a, int b) //This
    {
        return a+b;
    }
}
using System;

namespace _08.MathPower
{
    internal class Program
    {
        static void Main(string[] args)
        {

            Console.WriteLine("Hello World!");
        }
    }
    static int OperatorMethod(int a, int b) //This
    {
        return a+b;
    }
}
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Attempting to create a CRUD API
C#CC# / help
2y ago
CS0116 error
C#CC# / help
2y ago
❔ ✅ CS0116 [SOLVED]
C#CC# / help
3y ago
❔ TargetParameterCountException when trying to create a delegate from a method
C#CC# / help
3y ago