C# Error Does Not Contain A Static Main Method
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies
Error Does Not Contain A Static 'main' Method Suitable For An Entry Point
of this site About Us Learn more about Stack Overflow the company program does not contain a static 'main' method suitable for an entry point in c# Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges
.exe' Does Not Contain A Static 'main' Method Suitable For An Entry Point
Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: does not contain a static main method wpf Sign up Does not contain a static 'main' method suitable for an entry point up vote 33 down vote favorite 3 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 the same namespace and public partial asp.net 5 program does not contain a static 'main' method suitable for an entry point class name so the methods could be inter-operable. My header look like this in four files, including my main core file that calls: public shell() { InitializeComponent(); } Header area of .cs files that work with the UI (and seem to be causing this new conflict): using System; using System.Windows.Forms; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.IO; using System.Data.SqlServerCe; using System.Diagnostics; using System.Threading; using System.Collections.Specialized; using System.Net; using System.Runtime.InteropServices; using watin = WatiN.Core; using WatiN.Core.Native.InternetExplorer; using System.Web; namespace WindowsFormsApplication1 { public partial class shell : Form { Now when I try to debug/preview my application (BTW this is a Windows Application within Visual Studio 2010 Express) I get this error message: Does not contain a static 'main' method suitable for an entry point I looked in the application properties in Application->Startup object, but it offer me no options. How can I inform the application to begin at the .cs file that has my InitializeComponent(); command? I've looked around so far without a solution. The properties on each .cs file is set to 'Compile'. I d
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow
Does Not Contain A Static Main Method C# Console Application
the company Business Learn more about hiring developers or posting ads with us Stack Overflow app does not have a suitable static main method wpf Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7
Static Void Main(string Args) In C#
million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Troubleshooting “program does not contain a static 'Main' method” when it clearly does…? up vote 29 down vote favorite http://stackoverflow.com/questions/9607702/does-not-contain-a-static-main-method-suitable-for-an-entry-point 2 My MS Visual C# program was compiling and running just fine. I close MS Visual C# to go off and do other things in life. I reopen it and (before doing anything else) go to "Publish" my program and get the following error message: Program C:\myprogram.exe does not contain a static 'Main' method suitable for an entry point Huh? Yes it does... and it was all working 15 min earlier. Sure, http://stackoverflow.com/questions/386831/troubleshooting-program-does-not-contain-a-static-main-method-when-it-clearl I can believe that I accidentally hit something or done something before I closed it up... but what? How do I troubleshoot this? My Program.cs file looks like this: using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using System.Threading; namespace SimpleAIMLEditor { static class Program { [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new mainSAEForm()); } } } ...and there are some comments in there. There are no other errors. Help? c# compilation share|improve this question edited Sep 29 '12 at 22:12 BoltClock♦ 382k939341043 asked Dec 22 '08 at 17:36 adeena 1,510112845 add a comment| 11 Answers 11 active oldest votes up vote 33 down vote accepted Are the properties on the file set to Compile? share|improve this answer answered Dec 22 '08 at 17:45 Quibblesome 17.7k84688 1 That was it... I was looking at "build Actions" before I closed it and must have accidentally key-stroked my way to set the Program.cs to not compile. Thanks! –adeena Dec 22 '08 at 18:03 How can I check this? I'm having the same problem here... PS: Using vs2012 –Michel Ayres Feb 6 '13 at 18:22 1 Select the file in the project tree and open the properties window. The top value should be right one. –Quibblesome Feb 6 '13 at 18:24 add a c
SQL Server 2014 Express resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups TechRewards Events Community Magazine Forums Blogs Channel 9 Documentation APIs and reference Dev centers Retired content https://social.msdn.microsoft.com/Forums/en-US/5114949c-809f-46c0-ae72-d1c47c3882d5/exe-does-not-contain-a-static-main-method-suitable-for-an-entry-point?forum=csharplanguage Samples We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second. Ask a question Quick access Forums home Browse forums users FAQ Search related threads Remove From My Forums Answered by: .exe does not contain a static 'Main' method suitable for an entry point Archived Forums V > Visual C# Language Question 0 Sign in to vote i run a c# does not file , program.cs, with the scheduler..i encountered a error...the .exe does not contain a static 'Main' method suitable for an entry point..Can anyone tell what is means by the error message?Thanks.. Tuesday, November 04, 2008 5:47 AM Answers 0 Sign in to vote ok...solution already found..i run the code well without the line of code.. =) hehe ...thanks for who had help.. Marked as answer by wonderfulStar Wednesday, November 05, does not contain 2008 8:21 AM Wednesday, November 05, 2008 8:21 AM All replies 0 Sign in to vote Every program needs to have a method in it called Main(), that is static. This is what the computer calls when it starts your program. If there isn't one defined, that is the error you'll get.For a console application it normally looks like this: static void Main(string[] args) {For a forms application, it looks like this: static void Main() {DLLs don't normally have one, as they are not intended to run separately.How are you running the 'program.cs' file? Normally you run stuff that ends in '.exe' (which you get when you compile your program).Ron Whittle Tuesday, November 04, 2008 6:30 AM 0 Sign in to vote Hi, Ron..yup..i already have the static void Main method in my coding..Still in same error..i click on the debug to run the code. you means the .exe is created every time we run it? namespace runSchedule { class Program { static void Main(string[] args) { Tuesday, November 04, 2008 6:55 AM 0 Sign in to vote No, when you compile the code in Visual Studio, it creates an exe file. If you are in debug mode, thi