-
-
Save richlander/741057e8c0c1906efeb46d4f4c4281cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net5.0</TargetFramework> | |
<Nullable>Enable</Nullable> | |
</PropertyGroup> | |
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
Console.WriteLine("Hello World!"); |
Note: This implies no usage of command line parameters.
And if you want to access command line arguments, args is available as a "magic" parameter.
— https://devblogs.microsoft.com/dotnet/c-9-0-on-the-record/#top-level-programs
And if you want to access command line arguments, args is available as a "magic" parameter.
— https://devblogs.microsoft.com/dotnet/c-9-0-on-the-record/#top-level-programs
Thanks @qbit86.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Then, it would not work. This feature has been provided to facilitate rolling out single file programs - like the ones a developer of C program used to work with 😄
This feature is meant to work as a substitute for the effort to declare the
public static void Main()
method declaration. Note: This implies no usage of command line parameters.