473,511 Members | 16,260 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error " Project does not contain static method suitable for and entry Point "

1) I built and application that I called contact here is the script for it

Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Windows.Forms;
  5.  
  6. namespace Contacts
  7. {
  8. static class Program
  9. {
  10. /// <summary>
  11. /// The main entry point for the application.
  12. /// </summary>
  13. [STAThread]
  14. static void NotMain()
  15. {
  16. Application.EnableVisualStyles();
  17. Application.SetCompatibleTextRenderingDefault(false);
  18. Application.Run(new Form1());
  19. }
  20.  
  21. 2) then the book that I am using to teach my self C# asked me to create a new class and set the 1st entry to NotMain and create a main point on the new class that called Another class and here is the script for it
  22.  
  23. using System.Windows.Forms;
  24. using System;
  25. using System.Collections.Generic;
  26. using System.Linq;
  27. using System.Text;
  28.  
  29. namespace Contacts
  30. {
  31. class AnotherClass
  32. {
  33. public static void main()
  34. {
  35. MessageBox.Show("Pow!");
  36. }
  37. }
  38. }
the goal is to set the entry point in the secend class I created but instead C# gives me and error that there is no entry point and it is not recognizing the entry point I am creating. what could I be possibly be doing wrong
Nov 20 '10 #1
1 2232
Christian Binder
218 Recognized Expert New Member
It's because you wrote "main" instead of "Main", so just change it to
Expand|Select|Wrap|Line Numbers
  1. public static void Main()
  2. {
  3.   MessageBox.Show("Pow!");
  4. }
  5.  
and it should work.
Nov 22 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
537
by: Randy Crockett | last post by:
I have created a very simple DLL in VC++ 6.0, then created a very simple App in VC++ 6.0 to use the DLL and this works fine When I try to use the same DLL in C#, with DLLImport, the app finds the...
3
1607
by: CAN'T SEE THE SERVER FROM VS SERVER EXPL | last post by:
Hi, I am trying to connect a web service to an SQL Server 2000 database. SQL Server is installed and started and the database appears on the Enterprise MAnager window but it does not appear in...
3
2781
by: bauscharln | last post by:
hoi, I just wanted to add a static method to my interface, but that's not allowed! Is there a reason for this??? (Yes, I could make an abstract base class, but that's not what I want, since I...
0
2423
by: Sam Fields | last post by:
I have found very little regarding the error "Unable to find an entry point named EnumerateSecurityPackagesW in DLL security.dll. ". I have an ASP.NET Web Service being accessed via SSL. I found...
3
15489
by: Saman | last post by:
I have a third party dll and I am sure that it is not an activeX or dotnet assembly . I have check it up with Dependency Walker software and found the list of it's exported function in C++ syntax...
1
2383
by: lblr33 | last post by:
I downloaded cx_Oracle from http://www.cxtools.net/default.aspx?nav=cxorlb and selected the windows installer for Oracle 8i, Python 2.4 >From the readme.txt file: BINARY INSTALL: Place the...
1
6959
by: chavez98 | last post by:
Hello, I just installed Visual Studio 2005 and created a new windows project. I tried to run it but got this error "WindowsApplication2.exe' does not contain a static 'Main' method suitable for...
9
1840
by: gaya3 | last post by:
Hi all, How does the static method is called without creating any instance for that class?How does this functionality works?Thanks in Advance. -Thanks & Regards, Hamsa
0
1225
by: =?Utf-8?B?Z29oYXdrczAxMzc=?= | last post by:
Up until today I've been migrating groups, accounts, and computers with no issues. Today, when I attempt to migrate a group or an account I am getting a "the selected OU doesn't exist on the...
5
1819
by: DamienS | last post by:
Hi, I have a static method in a class and I need to be able to return a reference to "this". Googling around, I found a heap of discussions of the pros/cons of "abstract static" etc. It was...
0
7138
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7353
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7418
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7508
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3212
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.