What is the right way of getting my WinForms application's name?

nawfal picture nawfal · Mar 3, 2012 · Viewed 8.6k times · Source

I could do this

return Assembly.GetEntryAssembly().GetName().Name;

or

return Path.GetFileNameWithoutExtension(Application.ExecutablePath);

Would both give the desired application name always? If so which is a more standard way of getting application name? If its still a no-win situation is there anything like one method is faster than the other? Or else is there any other right approach?