I have converted dll to exe and build then it shows error exe does not contains static main method suitable for an entry point

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace abc
{
    public class Class1
    {
        public void display()
        {
            Console.WriteLine("Hallo");

        }
        public static void main(string[] args)
        {
            Class1 obj = new Class1();
            obj.display();
        }
    }
}

I have created one static method and called in main method to check how dll converted to exe work .

Jon Skeet
people
quotationmark

The entry point needs to be called Main, not main.

That's also in-keeping with .NET naming conventions, which I'd strongly urge you to follow:

  • Your namespace should be capitalized, e.g. Abc rather than abc
  • Your display method should be called Display

Somewhat-conventionally, the class containing the entry point is usually called Program too, but that's less of a strong convention. (It's a better name than Class1 though...)

Most of the time, the compiler doesn't care at all about naming conventions - but in the case of the entry point, the name Main is part of the language specification.

people

See more on this question at Stackoverflow