Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET
I had this as a job interview question.
 
My answer was the static int/void Main method, however, they said that was wrong and an application can be entered anywhere. Are they right? How is this possible? (ie: some type of debugging tool?)
 
Thanks.
Posted 5-Apr-13 16:18pm
Comments
Sergey Alexandrovich Kryukov at 5-Apr-13 23:02pm
   
Are you sure it was phrased exactly as you described? As such, it sounds gibberish. Perhaps you did not understand those people, or they didn't know what they are talking about. Anyway, I explain all which is involved in my answer, please see.
—SA

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

There is no such thing as "application can be entered". If you mean the entry point of the application, it can really be ambiguous. For such cases, there is a project option helping to select a class declaring the class used to define the application entry point; the entry point function itself is defined according to this:
http://en.wikipedia.org/wiki/Main_function#C.23[^].
 
To see how an entry point can be selected to resolve the ambiguity in Visual Studio, please take a look a the project properties. For C# compiler (csc.exe), options please see:
http://msdn.microsoft.com/en-us/library/6ds95cz0.aspx[^].
 
This is how the entry point is selected: http://msdn.microsoft.com/en-us/library/x3eht538.aspx[^].
 
As you can see, the name of the declaring class should be used.
 
—SA
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Marcin Kozub 310
1 OriginalGriff 248
2 Sergey Alexandrovich Kryukov 215
3 Richard MacCutchan 202
4 Praneet Nadkar 197
0 OriginalGriff 8,048
1 Sergey Alexandrovich Kryukov 7,287
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,910


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 5 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100