473,668 Members | 2,799 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 2240
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 DLL just fine but then says "Unable to find an entry point When I try to use "user32.dll" everything works, but doesn't with my DLL I am using .NET Framework 1.1 and VisualStudio .NET 2003 on Windows 2000 Pro
3
1618
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 the Server Explorer in VS2003.NET IDE window.It gives the error "Server does not exist or access is denied". I have re-installed both SQL server and VS but have not being able to solve this problem.
3
2785
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 don't need an implementation.) thank you in advance, bauscharln
0
2434
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 a website indicating that if any of your .dll names are security.dll, it could cause this issue. I happened to have named the service that -- so I renamed the service's dll, and it still didn't work. I decided to start from scratch, and built...
3
15498
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 for example : void __cdecl TelEnd(void) void __cdecl FaxStop(void) and so on ...
1
2401
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 file cx_Oracle.pyd or cx_Oracle.so anywhere on your Python path. So I tried this and set PYTHONPATH.
1
6963
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 an entry point". I've tried to compile other projects that compile for other people and got the same error. So I assumed it was an installation problem. So I uninsalled then reinstalled 2005 with the same CDs that have worked for other people and...
9
1849
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
1240
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 target domain." error message.
5
1828
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 quite a heated debate about purity of OO design that just did my head in a bit. In a nutshell. Can a static method 'know' what class it's defined in and return that type information?
0
8381
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8893
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8583
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8656
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7401
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6209
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4205
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2791
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 we have to send another system
2
1786
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.