Compiler warnings

When creating new code, we should aim to remove all compiler warnings.

If a compiler warning is not relevant, then it should be silenced using pragma warnings:

#pragma warning disable
// Code which has the warning
#pragma warning enable

See also: Nullable reference types for removing warnings about nullability in .Net 6 and later.