.NET NuGet

Updated: 30 June 2023

https://www.nuget.org/

Add a package

dotnet add package System.Data.OleDb --version 8.0.0-preview.5.23280.8

Remove package reference from a project file.

dotnet remove package System.Data.OleDb

Lists the package references for a project or solution.

dotnet list package

.NET

Updated: 29 January 2023

.NET is an open source developer platform (i.e. the Languages & Libraries) for building different types of apps. The supported languages are C#, Visual Basic and F#.

Target platforms are:

  • .NET Core which runs on Windows, Linux and macOS.
  • .NET Framework for websites, services and apps on Windows only.
  • Xamarin / Mono, a .NET for mobile e.g. iOS devices, Apple Watch/TV Android.

https://docs.microsoft.com/dotnet
https://aka.ms/dotnethelloworld

 

The Host

A container which offers built-in services:

  • Dependency injection – a technique for achieving Inversion of Control between classes and their dependencies.
  • Configuration
  • Logging
  • Options pattern
  • Host Services

.NET 6 offers Generic DefaultHost which can be configured for the application use cases.

Hosted Service

A service which performs work in the background. Any reference type object which implements IHostedService is a background / hosted / worker service.

DI Service Container

Class dependencies can be registered in a service container.

.NET provides a built-in service container, IServiceProvider. Services are typically registered at the app’s start-up and appended to an IServiceCollection. Once all services are added BuildServiceProvider is used to create the service container.

Dependency Injection injects the service into the constructor of the class where it’s needed. The framework takes on the responsibility of creating an instance of the dependency and disposing of it when it’s no longer needed.

Argbash

Updated: 10 January 2023

https://argbash.dev/

Create an argbash template file

argbash-init --pos positional-arg --opt optional-arg minimal.m4

Use the template file to create a script

argbash minimal.m4 -o my-script.sh

Re-generate script after editing Argbash section

argbash my-script.sh -o my-script.sh