C# Flags & Options
The main .NET language.All C# pages
- C# AllowUnsafeBlocks (-unsafe): fix CS0227 "Unsafe code may only appear if compiling with /unsafe"AllowUnsafeBlocks (csc -unsafe) lets C# use pointers and fixed, and fixes CS0227 Unsafe code may only appear if compiling with /unsafe.. What needs it.
- C# LangVersion (dotnet build -p:LangVersion): fix "Feature is not available in C# N"Set the C# LangVersion with dotnet build -p:LangVersion or in the .csproj, and fix CS9058 and CS8773 Feature is not available in C# N errors.. Values, defaults.
- C# Nullable=enable (dotnet build -p:Nullable): nullable reference type warningsC# Nullable=enable turns on nullable reference type warnings like CS8602 and CS8618. The four values enable, warnings, annotations, disable, and how to migrate.
- dotnet build -warnaserror / TreatWarningsAsErrors: fail the C# build on warningsdotnet build -warnaserror and TreatWarningsAsErrors fail a C# build on warnings. WarningsAsErrors, WarningsNotAsErrors, NoWarn and Directory.Build.props.