Library tutorials & articles
Program Entry point in C#
- Introduction
- Example 1 & 2
- Example 3 & 4
- More Examples
- Additional Examples
Example 3 & 4
kamran.cs
class zzz
{
public static void Main(int i)
{
}
}
Compiler Warning
kamran.cs(3,21): warning CS0028: 'zzz.Main(int)' has the
wrong signature to be an entry point
Compiler Error
error CS5001: Program 'kamran.exe' does not have an entry
point defined
Here, the compiler first displays a warning that Main has not been created with
the right parameters. The error, following the warning, proclaims that we have
forgotten to create a function called Main. The signature includes the return
type only in special cases as entry point.
kamran.csclass zzz
{
public static long Main()
{
return 0;
}
}
Compiler Warning
kamran.cs(3,20): warning CS0028: 'zzz.Main()' has the wrong
signature to be an entry point
Compiler Error
error CS5001: Program 'kamran.exe' does not have an entry
point defined
The signature refers to the parameters given to the function plus the return
value. Main in the above program returns 'long', hence we see the error.
Related articles
Related discussion
-
Concurrency violation: the UpdateCommand affected 0 of the expected 1 records
by virtualking (0 replies)
-
How to optimize mysql subquery performance?
by Jayaram P (0 replies)
-
C# video Editing/rendering
by pkuchaliya (0 replies)
-
How to Fill DataSet with more records (around 1 lakh) in a faster way
by Jayaram P (0 replies)
-
Can't print on the network with MSADESS ??
by anatha1 (2 replies)
Related podcasts
-
Object-Oriented Programming in Ruby
In this episode, I talk with Scott Bellware about object-oriented programming in Ruby, and Ruby's object model. This is taken from a private conversation, and the audio quality suffers at times. Much thanks to Scott for allowing this to be released.This episode of the Alt.NET Podcast is bro...
I am not discouraging you, but I just dont see a need for an article on this issue. One can find out those errors on trial and error basis with a test program. Give us something new and creative!
This thread is for discussions of Program Entry point in C# .