← All notes

C# nullable reference types

Short answer

Nullable reference types let you mark which references may be null. In a nullable-aware context the compiler warns when you dereference something that might be null. [S1][S2]

Points

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).

Source notice: .NET documentation © Microsoft. Licensed under Creative Commons Attribution 4.0 International (https://github.com/dotnet/docs/blob/main/LICENSE).

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Microsoft Learn, Nullable reference types - C#, CC BY 4.0 (dotnet/docs); Microsoft Learn, Nullable reference types, CC BY 4.0 (dotnet/docs).

Cite this

Permanent ID: iil:note:m8f4jqgd

iinventedlight. 2026. "C# nullable reference types: string vs string?" iinventedlight Library, iil:note:m8f4jqgd, version of 2026-11-04. https://iinventedlight.com/library/notes/csharp-nullable-reference-types/. License: CC-BY-4.0.

@misc{iil_note_m8f4jqgd,
  author = {{iinventedlight}},
  title = {{C\# nullable reference types: string vs string?}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-04},
  url = {https://iinventedlight.com/library/notes/csharp-nullable-reference-types/},
  note = {Permanent ID iil:note:m8f4jqgd. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/csharp-nullable-reference-types.md.