“does not contain a static ‘main’ method suitable for an entry point”

Every C# program needs an entry point. By default, a new c# Windows Forms project includes a Program class in a Program.cs file: using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace StackOverflow6 { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void … Read more

Replacing the WPF entry point

Some examples depict changing App.xaml’s Build Action from ApplicationDefinition to Page and writing your own Main() that instantiates the App class and calls its Run() method, but this can produce some unwanted consequences in the resolution of application-wide resources in App.xaml. Instead, I suggest making your own Main() in its own class and setting the … Read more