Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You've needed to have a project file in the past to compile .cs files, and this gets rid of that need. There are things that are part of more esoteric corners of Roslyn like .csx files that have allowed similar behavior in the past, but this fronts .cs directly as a scripting solution.

Scraping main() has been a thing for a while in dotnet — so called "Top-level programs" have be in since C# 9/.NET 5, aka about 5 years ago.

https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals...



Right, I think .Net 7 brought the top-level statements to Program.cs.

The oldest version of .Net I could find on Windows 11 was .Net 4, but it still compiles just great without a project file since it has since v1:

https://www.youtube.com/watch?v=KmIwGxcMOLg




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: