Getting started

This part of the C# course puts the SDK on the machine and takes a first program through the toolchain. It starts with what C# is and where it runs, installs the SDK, and then uses dotnet new, dotnet build and dotnet run on one program, with the project file, Main and top-level statements read line by line. The compiler comes next: nullable reference types, the first error and warnings turned into errors. The part closes with arguments and exit codes, dotnet publish in its three modes, and the commands of the CLI that this image does not have.

1.1 What C# is and where it runs the CLR, the SDK and the runtime, one program built and run Open 1.2 Install the .NET SDK the install pages per system, --list-sdks, --list-runtimes, the versions of this course Open 1.3 dotnet new, build and run the template, the three commands, what each writes, the exit status Open 1.4 The project file the SDK-style csproj, TargetFramework, OutputType, properties and items, obj and bin Open 1.5 Top-level statements and Main the four Main signatures, args, what the compiler generates Open 1.6 Namespaces, using and ImplicitUsings file-scoped namespaces, using, global using, the setting and what it hides Open 1.7 Nullable reference types string?, flow analysis, CS8602 and CS8600, why they are warnings Open 1.8 Read the first compiler error file, position, code and message, two errors in one file Open 1.9 Warnings as errors TreatWarningsAsErrors, -warnaserror, NoWarn, a warning that must stay a warning Open 1.10 Arguments, input and exit codes args, Console.ReadLine, Environment.ExitCode, a non-zero status Open 1.11 dotnet publish framework-dependent, self-contained and single-file, the sizes measured here Open 1.12 The CLI, and what is not here dotnet subcommands, format, fsi is F#, no csi, no dump or trace Open

Lessons