question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Program does not contain a static 'Main' method suitable for an entry point" error.

See original GitHub issue

Area of Cosmos - What area of Cosmos are we dealing with?

I am trying out Cosmos for making an “OS”. I am using Cosmos UserKit20190508 with Visual Studio 2019. I previously had few error which were resolved with the help of NuGet Packages. However, another error is popping out demanding a Main() method.

Expected Behaviour - What do you think that should happen?

OS emulator should open and the code should run in it as an OS.

Actual Behaviour - What unexpectedly happens?

I am getting an error in the Error List demanding a Main() method for “suitable entry point”.

Reproduction - How did you get this error to appear?

I normally clicked the green button with “Cosmos” written on it. And the error appeared in the Error List.

Version - Were you using the User Kit or Dev Kit? And what User Kit version or Dev Kit commit (Cosmos, IL2CPU, X#)?

I am using Cosmos UserKit20190508 with Visual Studio 2019.

Error Code and Error

Error Code: CS5001 Error Description: Program does not contain a static 'Main' method suitable for an entry point

This is the error (in the Error List dialog box at the bottom of the screen): Main()_cosmos

How do I resolve this error?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
quajakcommented, May 15, 2019

It should be set Class Library

1reaction
nixlscommented, May 14, 2019

Wasn’t able to reproduce on Visual Studio 2019 16.0.3 fresh install with cosmos user kit 20190508. I had the same error that is referenced but after 10 seconds it disappeared automatically.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does not contain a static 'main' method suitable for an entry ...
If you do have a Main method but still get this error, make sure that the file containing the Main method has "Build...
Read more >
Compiler Error CS5001
This error occurs when no static Main method with a correct signature is found in the code that produces an executable file. It...
Read more >
CS5001 C# Program does not contain a static 'Main' ...
Thanks for taking the time to file this issue. The problem here is the method is marked as private which is not legal...
Read more >
C# - Changing Main method to async causes entry point error
A fix for the error: "Program does not contain a static 'main' method suitable for an entry point" when changing a main method...
Read more >
Program does not contain a static 'Main' method suitable ...
The issue with your code is that your Main method not declared as neither public nor static. The correct definition is: public static...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found