Error Could Not Find Specified For 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 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 the program does not contain a static 'main' method suitable for an entry point 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 Could not find 'WindowsFormsApplication1.Program' specified for Main method after renaming name space up vote 41 down vote favorite 4 I have a C# app that had the default namespace "WindowsFormsApplication1". I decided that I would like to use a different namespace so I renamed "WindowsFormsApplication1". Now when I compile I get the error: "Could not find 'WindowsFormsApplication1.Program' specified for Main method". To rename the namespace I highlighted the namespace in a file and hit F2. How do I resolve this and change the actual namespace through out the project. I am using Visual C# 2010 Express. c# visual-studio-2010 namespaces share|improve this question edited Feb 24 '15 at 15:07 wonea 2,456949101 asked Mar 2 '12 at 18:23 Mausimo 2,87862961 add a comment| 2 Answers 2 active oldest votes up vote 89 down vote accepted In project -> properties change "startup object" to the new namespace. share|improve this answer edited Feb 24 '15 at 14:59 wonea 2,456949101 answered Mar 2 '12 at 18:27 Mausimo 2,87862961 3 came back to this again, +1 –TruthOf42 Sep 24 '13 at 15:56 after 2 hours,saved my day –Nicola Jun 13 '14 at 11:32 Perfect Save My Day :) –ujjaval Dec 25 '14 at 19:35 add a comment| up vote 3 down vote You should rename through the "Refаctor" feature of Visual Studio. share|improve this answer edited Sep 14 at 0:41 SSteve 6,45832144 answered Mar 2 '12 at 18:27 Stecenko Ruslan 25313 2 F2 = hotkey for refactor ;) –Mausimo Mar 2 '12 at 18:32 7 i did a recfactor like this and still had the same i
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{///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.