C#
28 guides on C#.
Articles where the C# is the point rather than an illustration — tool methods, typed responses, cancellation, disposal — including the places the SDK surface has moved recently enough that search results still show you the old shape.
Consuming MCP Servers from .NET: The Client Side
Most MCP writing is about building servers. The harder engineering is on the client — you are handing a model a tool list you did not write, from a process you did not start, and it can change under you at runtime.
Multi-Tenant AI Agents in .NET: Isolation That Actually Holds
Every tenant boundary you rely on in a normal web app — the connection string, the row filter, the claim — gets crossed differently once a model is in the loop. Here is where the leaks actually happen and what to do about each.
Human-in-the-Loop Approvals in Microsoft Agent Framework
An agent that can issue refunds needs a stop button. Agent Framework has two mechanisms for this — tool approval and workflow request ports — and picking the wrong one leaves you holding state you cannot survive a restart with.
Rate Limiting LLM Calls in .NET: Tokens, Not Requests
Provider quotas are measured in tokens per minute, but almost every .NET rate limiter counts requests. That mismatch is why your agent still gets 429s under a limiter that says it is doing its job.
Redacting PII Before It Reaches the Model: A .NET Pattern
Once a customer record leaves your process and lands in a model provider log, you cannot get it back. Here is a redaction layer for .NET that sits in front of the model, survives tool calls, and does not quietly break your prompts.
Vector Search in SQL Server 2025 with EF Core 10: One Less Database
SQL Server 2025 has a native vector type and EF Core 10 speaks it. For a lot of .NET teams that removes a whole moving part from the architecture — here is what it does well, and the ceiling you should check first.
Securing a Remote MCP Server in C#: OAuth 2.1 and Protected Resource Metadata
The moment an MCP server leaves localhost it becomes a public API with tool-calling attached. Here is what the spec actually requires, what the C# SDK gives you, and the parts you still have to think about.
Agentic RAG in .NET: When One Retrieval Is Not Enough
Classic RAG runs one search and hopes. Agentic RAG lets the model decide what to look up, how often, and when it has enough — here is what that costs and how to build it in C#.
Why Your .NET AI Agent Feels Slow (And What to Fix First)
Perceived latency in an agent is rarely the model. A latency budget for .NET agents — where the seconds actually go, measured, and the fixes ordered by what they return.
Model Routing and Fallback in .NET: One Interface, Several Models
Route each request to the cheapest model that can handle it, and fail over when a provider degrades — built on Microsoft.Extensions.AI with C# you can drop into an existing app.
Prompt Injection in .NET Agents: What Actually Works as a Defence
Prompt injection is not a prompt problem, so prompt fixes do not solve it. A .NET engineer's guide to the defences that hold — capability scoping, provenance tracking, output gating — with C# you can lift.
30 .NET AI & Agent Interview Questions (With Answers That Actually Land)
The AI questions .NET developers are being asked in 2026 — fundamentals, Microsoft.Extensions.AI, the Agent Framework, RAG, tools and production concerns — with model answers and what each one is really testing.
Migrating from Semantic Kernel to the Microsoft Agent Framework: A C# Walkthrough
A line-by-line C# migration from Semantic Kernel agents to the Microsoft Agent Framework — namespaces, agent creation, threads, tools, invocation, options and DI, with before/after code for each.
Text-to-SQL in .NET: Letting Users Query a Database in Plain English (Safely)
Build a natural-language-to-SQL feature in C# — schema grounding, a read-only execution boundary, statement validation and the failure modes that decide whether it survives production.
Using the Anthropic Claude API in C#
How to call Anthropic's Claude models from C#: authenticate, send a message, stream the response, and use Claude through the provider-agnostic Microsoft.Extensions.AI abstraction.
Build a "Chat with your PDF" App in .NET
Let users ask questions about a PDF and get grounded answers. Build a chat-with-your-documents app in C# using extraction, embeddings, and retrieval-augmented generation.
How to Count Tokens in C#
Tokens drive LLM cost and context limits. How to count tokens in C# with a tokenizer, estimate cost before a call, and keep prompts under the model's limit.
Embeddings in .NET, Explained
What are embeddings, and how do you generate and use them in C#? A clear, practical explanation of vector embeddings for .NET developers — with code and use cases.
Using Google Gemini in C# and .NET
How to call Google's Gemini models from C#: get an API key, send a prompt, stream responses, and use Gemini through a provider-agnostic interface in .NET.
Microsoft.Extensions.AI: The .NET AI Abstraction, Explained
Microsoft.Extensions.AI gives .NET one common interface for every AI provider. What IChatClient and IEmbeddingGenerator are, why they matter, and how to use them.
How to Use Function Calling with OpenAI in C#
Function calling lets an OpenAI model trigger your C# code. A step-by-step guide to defining functions, letting the model call them, and returning the result — in .NET.
Prompt Engineering for .NET Developers
Prompt engineering, minus the hype. Practical techniques .NET developers can use to get reliable, consistent output from an LLM — with C# examples.
Chunking Strategies for RAG (with .NET Examples)
Bad chunking is the #1 reason RAG underperforms. A practical guide to chunking strategies — size, overlap, and structure-aware splitting — for .NET RAG apps.
Resilient LLM Calls in .NET with Polly
LLM APIs rate-limit, time out, and hiccup. Make your .NET AI calls resilient with Polly — retries with backoff, circuit breakers, and timeouts done right.
Building Semantic Search in C# with Embeddings
Keyword search misses meaning. Build semantic search in C# using embeddings and vector similarity, so queries match by intent — not just matching words.
Building Your Own MCP Server in C#
Expose your tools to any AI agent by building an MCP server in C#. A practical walkthrough of the Model Context Protocol server SDK, defining tools, and choosing a transport.
How to Call the OpenAI API from C# (2026 Guide)
A step-by-step guide to calling the OpenAI API from C#: install the SDK, send your first chat completion, stream responses, and keep your API key safe in .NET.
Running a Local LLM in .NET with Ollama
Run an LLM locally and call it from C# with Ollama — no API key, no cloud, no per-token cost. How to connect .NET to a local model and when local makes sense.