.net-core

Topics related to .net-core:

Getting started with .net-core

.NET Core is a general purpose development platform maintained by Microsoft and the .NET community on GitHub.

The following characteristics best define .NET Core:

  • Flexible deployment: Can be included in your app or installed side-by-side user- or machine-wide.
  • Cross-platform: Runs on Windows, macOS and Linux; can be ported to other OSes. The supported Operating Systems (OS), CPUs and application scenarios will grow over time, provided by Microsoft, other companies, and individuals. .NET can also be used in device, cloud, and embedded/IoT scenarios.
  • Command-line tools: All product scenarios can be exercised at the command-line.
  • Compatible: .NET Core is compatible with .NET Framework, Xamarin and Mono, via the .NET Standard Library.
  • Open source: The .NET Core platform is open source, using MIT and Apache 2 licenses. Documentation is licensed under CC-BY. .NET Core is a .NET Foundation project.
  • Supported by Microsoft: .NET Core is supported by Microsoft, per .NET Core Support

Composition

.NET Core is composed of the following parts:

  • A .NET runtime which provides a type system, assembly loading, a garbage collector, native interop, and other basic services.
  • A set of framework libraries which provide primitive data types, app composition types, and fundamental utilities.
  • A set of SDK tools and language compilers that enable the base developer experience, available in the .NET Core SDK.
  • The 'dotnet' app host which launches .NET Core apps. The app host selects and hosts the runtime, provides an assembly loading policy, and launches the app. The same host is also used to launch SDK tools in a similar fashion.

(Source: official documentation.)

The global.json

The global.json file is extremely powerful and unique to .NET Core and ASP.NET Core applications.

Building libraries with .NET Core

Installing .NET Core on Linux

.NET Core with Docker

Fill with examples of using Docker on .NET Core platform, official base images for .NET Core application and self-hosted .NET Core app as well

.NET Core command line interface

Understanding System.Runtime vs. mscorlib

Every .NET library and programming language utilize a set of elementary data types like System.Int32, System.Object, System.Type or System.Uri. These data types form the base of all other structures including all custom written .NET libraries. All these types are hosted in a base library, which is either mscorlib or System.Runtime.

The libraries which can be used with .NET Core are based on System.Runtime core library while for the .NET Framework (the Windows component) they are based on mscorlib. This essential difference lead to...

  • the incompatibility of older libraries since they expect a type System.Object, mscorlib while a .NET Core library would expect System.Object, System.Runtime.
  • a type forwarding facade library called System.Runtime to the mscorlib in the .NET Framework. This library is otherwise (nearly) empty but enables the usage of System.Runtime based PCL libraries on the .NET Framework.
  • a type forwarding mscorlib to the System.Runtime in a future version of .NET Core.
  • the introduction of the portable class library concept (PCL) and as a second generation the netstandard as a method of unification between the two core libraries.

AND out of that, countless questions on Stack Overflow.

Getting started with appsetting.json

Components and Versioning in .NET Core

How components in .NET Core are versioned.

Components

.NET Core consists of multiple components that are each versioned independently and can often be mixed and matched.

  • Shared Framework. This contains the APIs and the Virtual Machine and other runtime services needed for running .NET Core applications.

    • The current .NET Core Virtual Machine is called CoreCLR. This executes the .NET bytecode by compiling it JIT and provides various runtime services including a garbage collector. The complete source code for CoreCLR is available at https://github.com/dotnet/coreclr.

    • The .NET Core standard APIs are implemented in CoreFX. This provides implementations of all your favourite APIs such as System.Runtime, System.Theading and so on. The source code for CoreFX is available at https://github.com/dotnet/corefx.

  • Host is also called the muxer or driver. This components represents the dotnet command and is responsible for deciding what happens next. The source for this is available at https://github.com/dotnet/core-setup.

  • SDK is also sometimes called the CLI. It consists of the various tools (dotnet subcommands) and their implementations that deal with building code. This includes handling the restoring of dependencies, compiling code, building binaries, producing packages and publishing standalone or framework dependent packages. The SDK itself consists of the CLI, which handles command line operations (at https://github.com/dotnet/cli) and various subprojects that implement the various operations the CLI needs to do.

Components in .NET Core installations

Various official and unoffical packages, tarballs, zips and installers for .NET Core (including those available on https://dot.net/core) provide .NET Core in many variants. Two common ones are SDKs and Runtimes.

Each SDK install or Runtime install contains a number (possibly 0) of hosts, sdk and shared framework components described above.

  • .NET Core Runtime contains

    • 1 version of Shared Framework
    • 1 version of the Host
  • .NET Core SDK contains

    • 1 or more versions of the Shared Framework (varies depending on the version of the SDK)
    • 1 version of the Host
    • 1 version of the SDK