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 .
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:
Abc
rather than abc
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.
See more on this question at Stackoverflow