I began organizing my code to day into seperarate .cs files, and in order to allow the methods that work with the UI to continue to do so I would create the .cs code under t
I am using Visual Studio and also had this problem. It took me some time, but in my program it was caused because I accidentally deleted a Class named "Program" that is generated automatically.
I had this error and solved it using this solution.
I too have faced this problem. Then I realized that I was choosing Console Application(Package) rather than Console Application.
Try adding this method to a class and see if you still get the error:
[STAThread]
static void Main()
{
}
After placing the above code in Program.cs, follow these steps:
Right click on the project
Select "Properties"
Set "Output Type" to "Windows Application"
Startup object : namepace.Program