Home > Net >  Could you tell me how to use multiple Main use/Main?
Could you tell me how to use multiple Main use/Main?

Time:09-17

Would you please tell me why I wrote this as a book to perform error?

CodePudding user response:

Error one, because there are two Main, there are two programs is the entry point, the compiler doesn't know what a complain,
One solution is to remove a,

Error 2, because the Console class in the System namespace is not quoted,
The solution is, in the cs file head plus a line using System;

CodePudding user response:

reference 1st floor github_36000833 response:
error one, because there are two Main, there are two programs is the entry point, the compiler doesn't know what a complain,
One solution is to remove a,

Error 2, because the Console class in the System namespace is not quoted,
The solution is, in the cs file head plus a line using System;

But the book this example can be normal output

CodePudding user response:

refer to the second floor weixin_46698907 response:
Quote: refer to 1st floor github_36000833 response:
error one, because there are two Main, there are two programs is the entry point, the compiler doesn't know what a complain,
One solution is to remove a,

Error 2, because the Console class in the System namespace is not quoted,
The solution is, in the cs file head plus a line using System;

But the book this example can be normal output

Only captures the main code of the book, will not intercept all, reading don't formulaic

CodePudding user response:

reference ajdkjalj reply: 3/f
Quote: refer to the second floor weixin_46698907 response:

Quote: refer to 1st floor github_36000833 response:
error one, because there are two Main, there are two programs is the entry point, the compiler does not know in which one so complain,
One solution is to remove a,

Error 2, because the Console class in the System namespace is not quoted,
The solution is, in the cs file head plus a line using System;

But the book this example can be normal output

Only captures the main code of the book, will not capture all, reading don't rotte

Thank you for your guidance!
  •  Tags:  
  • C#
  • Related