Skip to content

Instantly share code, notes, and snippets.

@longtth
Last active June 23, 2019 08:53
Show Gist options
  • Save longtth/424021f000e5574093c5f2144a49af78 to your computer and use it in GitHub Desktop.
Save longtth/424021f000e5574093c5f2144a49af78 to your computer and use it in GitHub Desktop.
for Quora question Why Microsoft don't make .NET Core simple to just a MainClass.cs file and a void Main(){}?

Not to mention about Python mess, with print("hello") in commandline.
Let say with Java, you just need a MainClass.java with void Main() {} and the compiler know what to do.
But with Csharp, even with .NET Core, we must dotnet new console -n DemoApp then we have 2 files: DemoApp.csproj and Program.cs for a simple Hello World program to run.
It would be better if dotnet.exe could help run directly in a folder with a Program.cs file like:

dotnet run .

it will be better for quick demo in college, when we back to the industry, let them learn to use *.csproj later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment