First, you need to take a look at Microsoft DotNET – Core website.
This website will be the start for any .NET and C# issue on any operating system Linux, Windows, Mac or Docker.
I used for this tutorial Windows OS and for Fedora distro you can take a look here.
First, you need to
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | C:\BackUP\Proiecte\>dotnet new console -o appconsole001 The template "Console Application" was created successfully. C:\BackUP\Proiecte\>cd appconsole001 C:\BackUP\Proiecte\appconsole001>dotnet --info .NET Command Line Tools (1.1.0) Product Information: Version: 1.1.0 Commit SHA-1 hash: d6f4336106 Runtime Environment: OS Name: Windows OS Version: 10.0.15063 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\1.1.0 C:\BackUP\Proiecte\appconsole001>dotnet --help .NET Command Line Tools (1.1.0) Usage: dotnet [host-options] [command] [arguments] [common-options] Arguments: [command] The command to execute [arguments] Arguments to pass to the command [host-options] Options specific to dotnet (host) [common-options] Options common to all commands Common options: -v|--verbose Enable verbose output -h|--help Show help Host options (passed before the command): -d|--diagnostics Enable diagnostic output --version Display .NET CLI Version Number --info Display .NET CLI Info Commands: new Initialize .NET projects. restore Restore dependencies specified in the .NET project. build Builds a .NET project. publish Publishes a .NET project for deployment (including the runtime). run Compiles and immediately executes a .NET project. test Runs unit tests using the test runner specified in the project. pack Creates a NuGet package. migrate Migrates a project.json based project to a msbuild based project. clean Clean build output(s). sln Modify solution (SLN) files. Project modification commands: add Add items to the project remove Remove items from the project list List items in the project Advanced Commands: nuget Provides additional NuGet commands. msbuild Runs Microsoft Build Engine (MSBuild). vstest Runs Microsoft Test Execution Command Line Tool. C:\BackUP\Proiecte\appconsole001>dotnet run Hello World! |
The result of Hello World! show us the console application works well.
This will run this program:
1 2 3 4 5 6 7 8 9 10 11 12 | using System; namespace appconsole001 { class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); } } } |
You can change the text Hello World or test something else.
If you got errors you need to fix it with :
1 2 3 | C:\BackUP\Proiecte\dotnet restore appconsole001 Restoring packages for C:\BackUP\Proiecte\appconsole001\appconsole001.csproj... ... |