Error 1 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 Us Learn more about Stack
Cs1555
Overflow the company Business Learn more about hiring developers or posting ads with us program does not contain a static 'main' method suitable for an entry point Stack Overflow Questions Jobs Documentation Tags Users Badges 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: 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,87852961 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,87852961 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 issue –TruthOf42 Sep 24 '13 at 15:56 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook S
ASP.NET Community Standup Forums Help Home/ASP.NET Forums/.NET Languages/C#/Error 1 Could not find 'prop.Program' specified for Main method prop Error 1 Could not find 'prop.Program' specified for Main method prop [Answered]RSS 2 replies Last post Nov 16, 2008 08:10 AM by SGWellens ‹ Previous Thread|Next Thread › Print Share Twitter Facebook Email Shortcuts Active Threads Unanswered Threads Unresolved Threads Support Options Advanced Search Reply srinivasgoud None 0 Points 17 Posts Error 1 Could not find 'prop.Program' specified for Main method prop Nov 16, 2008 12:24 AM|srinivasgoud|LINK using System;
using System.Collections.Generic; using System.Linq; using System.Text; namespace prop { // PropApp.cs - http://stackoverflow.com/questions/9538404/could-not-find-windowsformsapplication1-program-specified-for-main-method-afte Using Properties //--------------------------------------------- class Point { int my_X; // my_X is private int my_Y; // my_Y is private public int x { get { return my_X; } set { my_X = value; } } public int y { get { return my_Y; } set { my_Y = value; } } } class PropApp { public static void Main() { Point starting = new Point();Point ending = new http://forums.asp.net/t/1348703.aspx?Error+1+Could+not+find+prop+Program+specified+for+Main+method+prop Point(); starting.x = 1; starting.y = 4; ending.x = 10; ending.y = 11; Console.WriteLine("Point 1: ({0},{1})", starting.x, starting.y); Console.WriteLine("Point 2: ({0},{1})", ending.x, ending.y); Console.ReadLine(); } } } Reply Svante Star 9720 Points 2286 Posts Re: Error 1 Could not find 'prop.Program' specified for Main method prop Nov 16, 2008 04:48 AM|Svante|LINK You have renamed the main class 'Program' to 'PropApp', but not told Visual Studio about it. Right-click your project in the solution explorer, select 'Properties'. Under the 'Application' tab, choose the 'startup object' dropdown, and select 'prop.PropApp'. Svante AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com [Disclaimer: Code snippets usually uncompiled, beware typos.] ______ Don't forget to click "Mark as Answer" on the post(s) that helped you. Reply SGWellens All-Star 124309 Points 10172 Posts Moderator Re: Error 1 Could not find 'prop.Program' specified for Main method prop Nov 16, 2008 08:10 AM|SGWellens|LINK FYI, .Net has already defined a Point class: System.Drawing.Point Steve Wellens My blog ‹ Previous Thread|Next Thread › This site is managed for Microsoft by Neudesic, LLC. | © 2016 Microsoft. All rights reserved. Privacy Statement| Terms of Use| Contact Us| Advertise With Us| CMS by Umbraco| Hosted on Microsoft Azure FeedbaApplication -> http://p2p.wrox.com/c-2005/51068-could-not-find-windowsapplication1-program.html 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 error 1 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 error 1 could 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.
Unanswered Topics Wrox Programmer Forums > C# and C > C# 2005 > C# 2005 could not find WindowsApplication1.program ?? User Name Remember Me? Password Reminder Password Register Register | FAQ | Members List | Calendar | Today's Posts | Search C# 2005 For discussion of Visual C# 2005. Search Forums Show Threads Show Posts Advanced Search Find All Thanked Posts Go to Page... Welcome to the p2p.wrox.com Forums. You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free . Thread Tools Display Modes #1 (permalink) December 4th, 2006, 01:39 AM Hannibal Authorized User Join Date: Feb 2006 Location: Bangalore, Karnataka, India. Posts: 63 Thanks: 1 Thanked 0 Times in 0 Posts could not find WindowsApplication1.program ?? Hi... I had created a windows application using c#. Initially the solution file name as well as the namespace was WindowsApplication1,which is the default. But then i renamed the solution as WinService. The namespace is also changed as WinService. But when i try to run the project, i am getting an error as : Could not find 'WindowsApplication1.Program' specified for Main method WinService. It is also not showing any line numbers. I searched in all my doucments and program.cs file, but i couldnt locate WindowsApplication1, as i had changed everything to WinService. what is wrong? Please help #2 (permalink) December 4th, 2006, 03:40 AM Hannibal Authorized User Join Date: Feb 2006 Location: Bangalore, Karnataka, India. Posts: 63 Thanks: 1 Thanked 0 Times in 0 Posts Hi.. I found out the solution. I changed the project properties to the WinService.Program. The project is working. « Previous Thread