✅ namespaces
every time i try to use namespace and class i get
Error CS5001 Program does not contain a static 'Main' method suitable for an entry point
what am i supposed to do because
gives the same error as
22 Replies
show the project file
wdym
.csproj
huh, it should work
does it work if you name the class Program by any chance?
no
namespaces just dont work for idk why reason
are there any other files?
?
its a completely new console app
are there any other source files in the project
no
am i supposed to have more files?
just asking for more context
$main
$mains
$mains
The possible signatures for
Main
are public
is not required (can be any accessibility).
Top-level statements are compiled into a Main
method and will use an appropriate signature depending on whether args
is referenced, the await
operator is used and/or an explicit return
statement is used.
https://docs.microsoft.com/en-US/dotnet/csharp/fundamentals/program-structure/main-command-lineMain() and command-line arguments
Learn about Main() and command-line arguments. The 'Main' method is the entry point of an executable program.
maybe they want it to be public now?
nope
tried that too
same thing
well you might be mistaken somewhere, maybe you're running a different project
wdym
maybe someone is trolling you by messing with the msbuild sdk
the namespace should not affect this
might be the class
its the class
class isnt working
gives the same error
im confused now
maybe your namespace naming? can you share us snippet of your files in format?
it works when using a different thing???
im not sure whats going on
created a new project and it somehow worked?