Question Details

No question body available.

Tags

c#

Answers (1)

Accepted Answer Available
Accepted Answer
March 19, 2026 Score: 14 Rep: 156 Quality: Expert Completeness: 50%

The !! after a parameter name is the parameter null-check operator, a feature that was proposed for C# 11 but ultimately reverted and never shipped in any public C# release.

When used, string value!! would automatically generate a null-check equivalent to:

if (value is null) throw new ArgumentNullException(nameof(value));

The reason it appears in the .NET Runtime source code but won't compile in your project is that the .NET Runtime uses a custom fork of the Roslyn compiler that still includes this experimental syntax internally. The public C# compiler (the one Visual Studio and dotnet build use) never included it, so it's a syntax error for everyone outside the runtime's own build system.