Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


[.net] does not contain a static 'Main' method


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Lucidquiet   Members   -  Reputation: 199

Like
0Likes
Like

Posted 29 May 2007 - 01:02 PM

Error: error CS5001: Program 'c:\MyProject\MyProject\Program.exe' does not contain a static 'Main' method suitable for an entry point Can somebody clarify this error for me please? And also how to go about remedying the problem. Thanks, L-

Sponsor:

#2 Driv3MeFar   GDNet+   -  Reputation: 1076

Like
0Likes
Like

Posted 29 May 2007 - 01:03 PM

All programs need an entry point, in this case a Main() function (that is static).

You didn't specify the language you're using (I'm guessing c#...?), but look up any beginner tutorial for your language and it should cover Main().

#3 Lucidquiet   Members   -  Reputation: 199

Like
0Likes
Like

Posted 29 May 2007 - 01:21 PM

I understand that I need a Main, but what if I'm just writing a library, a DLL, then how do I specify that I don't need, or want, a public void static Main() method?

If I just set the output type to 'library' should that take care of this problem or do I have to specify via some attribute?


L-

#4 Spoonbender   Members   -  Reputation: 1254

Like
0Likes
Like

Posted 29 May 2007 - 01:27 PM

Quote:
Original post by Lucidquiet
I understand that I need a Main, but what if I'm just writing a library, a DLL, then how do I specify that I don't need, or want, a public void static Main() method?

If I just set the output type to 'library' should that take care of this problem or do I have to specify via some attribute?


L-


Setting the output type to class library (or is it just 'library'?) should do the trick, yes.

#5 jsnape183   Members   -  Reputation: 149

Like
0Likes
Like

Posted 29 May 2007 - 01:33 PM

If your using some Visual Studio variant when creating a project just select Library or DLL or whatever the option is called, that should fix your problem :).




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS