C# Error 1 Could Not Find Specified For Main Method
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 could not find app specified for main method Us Learn more about Stack Overflow the company Business Learn more about hiring cs1555 developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join
Program Does Not Contain A Static 'main' Method Suitable For An Entry Point
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: Sign up Error “Could not find xxxx.Program specified for main method” creating Windows Service from MS example up vote 1 down vote favorite I am following this guide to create a windows service > http://msdn.microsoft.com/en-us/library/zt39148a(v=vs.110).aspx However when I try and build it on the auto generated page called "Program.cs" That has this code in it namespace BetfairBOTV2Service { static class Program { /// /// The main entry point for the application. /// static void Main() { ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new BrainiacVersion2() // not green though!!!!! }; ServiceBase.Run(ServicesToRun); } } } I get this error "Could not find BrainiacV2.Program" specified for Main Method I did everything the tutorial told me to. I have an App.Config, a Program.cs (code above), a BrainiacV2.cs which holds all my code for the service and starts like this namespace BetfairBOTV2Service { public partial class BrainiacV2 : ServiceBase { public BrainiacV2() { InitializeComponent(); My ProjectInstaller.cs with two installer objects on them (name) serviceInstaller Display Name: My new BetfairBotV2 ServiceName: BrainiacVersion2 And that is that. This is the only error I am getting The solution is called BrainiacV2 I have tried changing the code in Program.cs to new BrainiacV2() which turns it green but then I just get Could not find BrainiacV2.Program specified for main method. What am I doing wrong or need to change? Any help would be much appreciated - thanks! Win 7, 64 bit, .NET 4.5, C# .net windows c#-4.0 service windows-services share|improve this question edited Aug 28 '14 at 18:49 Reg Edit 2,7231225 asked Aug 28 '14 at 18:36 MonkeyMagix 182110 add a comment| 3 Ans
Main method C5StatMenu Visual Studio Languages , .NET Framework > Visual C# Question 0 Sign in to vote and my Main looks like this: using System;using System.Collections.Generic;using System.Windows.Forms;
namespace C5StatMenu{static class Program{///
/// The main entry point for the application./// [STAThread]static void Main(){Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefault(false);Application.Run(new frmC5StatMenu());}}}What is wrong ?Best regardsKSor, Denmark Friday, June 27, 2008 9:03 AM Reply | Quote Answers 0 Sign in to vote Hi PSASor,I do think there is no error in your code snippet above, if you cannot figure the issue out, the most convenient way is create a new windows form project and paste the code.1. Open the Visual Studio IDE, Create a new “Windows forms Application” project in
http://stackoverflow.com/questions/25555731/error-could-not-find-xxxx-program-specified-for-main-method-creating-windows-s C#, you can named the project as “C5StatMenu”.2. Add a new form item to the project which named “frmC5StatMenu”, and then paste your code snippet to the “Program.cs” file.3. Compile and run the project.Regards,XunPlease remember to mark the replies as answers if they help and unmark them if they provide no help. Marked as answer by jack 321 Wednesday, July 02, 2008 10:51 AM Tuesday, July 01, 2008 6:12 AM Reply | Quote All
https://social.msdn.microsoft.com/Forums/vstudio/en-US/c3a66145-3e2f-491c-9fa3-98c333e59e60/error-could-not-find-periodestatistikprogram-specified-for-main-method-c5statmenu?forum=csharpgeneral replies 0 Sign in to vote Hi PSASor,I do think there is no error in your code snippet above, if you cannot figure the issue out, the most convenient way is create a new windows form project and paste the code.1. Open the Visual Studio IDE, Create a new “Windows forms Application” project in C#, you can named the project as “C5StatMenu”.2. Add a new form item to the project which named “frmC5StatMenu”, and then paste your code snippet to the “Program.cs” file.3. Compile and run the project.Regards,XunPlease remember to mark the replies as answers if they help and unmark them if they provide no help. Marked as answer by jack 321 Wednesday, July 02, 2008 10:51 AM Tuesday, July 01, 2008 6:12 AM Reply | Quote 1 Sign in to vote Hello, you can directly rename the periodeStatik.Program byC5StatMenu.Programin the "yourProjectName.csproj" file, in the balise :
C5StatMenu.Program Regards, Michael Tuesday, August 24, 2010 3:43 PM Reply | Quote Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.Would you like to participate? Privacy statement Dev Centers Windows Office More... Related Sites Visual Studio Visual Studio Integrate VSI
Application -> Startup object areferenceto an non-existing class. We usually encounter this error after renaming our main project's namespace. Visual Studio's rename command won't change your Startup object to the newly could not renamed class, so make sure you change it to the new namespace after the rename! Frequent error messages: Could not find 'Program' specified for Main method Could not find 'Shell.App' specified for Main method Posted by could not find Itay Adler at 12:54 Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: Startup object, visual studio No comments: Post a Comment Older Post Home Subscribe to: Post Comments (Atom) itayadler's shared items Blog Archive ▼ 2011 (2) ▼ March (2) Could not find 'Program' specified for Main method... Greplin Challenge Solution ► 2010 (3) ► September (3) ► 2009 (1) ► January (1) ► 2008 (3) ► December (2) ► November (1) Subscribe To Posts Atom Posts Comments Atom Comments Followers Recommended Links Slidex - Our stage, your show TechCrunch CodePlex DotNetKicks - The .NET Digg Slidex at Reader.co.il Awesome Inc. template. Powered by Blogger.