Chapter 1 – Hello, C#! Welcome, .NET Core!
Why can a programmer use different languages to write applications that run on .NET?
Multiple languages are supported on .NET because each one has a compiler that translates the source code into IL (intermediate language) code. This IL code is then compiled to native CPU instructions at runtime by the CLR.
What do you type at the Command Prompt to compile C#?
For .NET Framework, we type
csc sourcecode.cs
For .NET Core using .NET CLI in a folder with a
project.json
file, we typedotnet build
What is the Visual Studio 2015 keyboard shortcut to save, compile, and run an application without attaching the debugger?
Ctrl + F5
What is the Visual Studio 2015 keyboard shortcut to view the Error List?
Ctrl + W, E
What does
ildasm.exe
do?The IL Disassembler (
ildasm.exe
) tool reveals the manifest, metadata, embedded resources, and IL code inside a compiled .NET assembly.Is the .NET Core better than the .NET Framework?
It depends on what you need. The .NET Core is a slimmed down, cross-platform version of the more full-featured, mature .NET Framework.
How is .NET Native different from .NET Core?
.NET Native is an ahead-of-time compiler that can produce native code assemblies that have better performance and reduced memory footprint, and it has its .NET assemblies statically linked, which removes its dependency on CoreCLR.
What does the .NET Portability Analyzer do?
It scans an assembly and produces a report that lists any features the assembly uses that are not supported on your chosen target platform. For any missing features, it can make a recommendation to use an alternative.
What is the difference between Git and GitHub?
Git is a source code management platform. GitHub is a popular web service that implements Git.
What is the name of the entry point method of a .NET application and how should it be declared?
public static void Main()
Its name is Main and the preceding code is how it is declared. An optional string array for command-line arguments and a return type of
int
are recommended, but they are not required.