I’m using this tutorial to learn how C#, and I copy the code from the tutorial into my repl but I get the same error:
CSC : error CS1555: Could not find 'Program' specified for Main method [/home/runner/C/main.csproj]
The build failed. Fix the build errors and run again.
exit status 1
Here’s the repl:
This is the tutorial I was using:
Please help me fix this problem. I am completely new to C#.
Replit is probably set up differently than w3schools. I recommend comparing the replit template to the w3schools code and finding what is wrong.
namespace, and your code should work:
repl link here
Replit only runs the
static void main method in the
Program class. It cannot be in a
namespace, and this is because of the
main.csproj file which says what file to run.
Learn more: Cannot select Main Method as Startup object in Visual Studio Express 2010? - Stack Overflow
in fact, if you remove line 6 from the .csproj file, you can have the program just like this