Skip to main content

.NET and AI

The AI ecosystem is overwhelmingly documented through a Python lens. Search for "how to build an AI application" and you will receive Python tutorials. Search for "AI in C#" and you will receive Python tutorials with an apologetic footnote. These terms cover the C#/.NET libraries and language features that exist for AI development, because they do exist, and they're actually quite good, and no, I will not be taking questions about why I didn't just use Python.

TermWhat it is
Semantic KernelMicrosoft's SDK for integrating LLMs into .NET, the closest thing to LangChain in C#
ML.NETMicrosoft's framework for traditional ML in .NET: classification, regression, anomaly detection
ONNX RuntimeAn inference engine for running ML models locally (PDF for neural networks)
NuGetThe .NET package manager (npm for the C# ecosystem)
Nullable Reference TypesA compiler feature killing null reference exceptions, the billion-dollar mistake fix
Pattern MatchingConcise, readable branching logic that makes if-else chains weep
RecordsImmutable, value-based types with zero boilerplate. Data that documents itself
File-Scoped NamespacesOne less indentation level per file, greater than the sum of its parts