Developers can add artificial intelligence features to existing or new C# applications. Adding AI features to .NET software can now be accomplished very fast.
Benefits of using AI with .NET
Access to Large & Small Language Models
Large and small language models from OpenAI, Mistral, Cohere, and Meta are available through Azure, GitHub Models, or Hugging Face and can be invoked directly from .NET code or via official SDKs.
Native Vector Databases for High-Dimensional Search
Vector databases such as Milvus, Qdrant, and Azure AI Search store and query embeddings so high-dimensional data can be searched efficiently at production scale.
Rich .NET AI Libraries & SDKs
Libraries — including Semantic Kernel, Azure AI Foundry, Azure AI Inference SDK, ML.NET, and Microsoft.Extensions.AI — provide components for prompt handling, model orchestration, and streaming responses.
Generative & Analytical Use Cases
Developers can build chat interfaces, summarize large text collections, generate text, code, images, or audio, and run semantic search or analytics over document repositories.
Multimodal Vision, Speech & Workflow Automation
The same approach extends to computer vision pipelines that detect objects in images or video, speech synthesis services that produce natural voices, classification systems that label incoming issues, and workflow automation that triggers downstream tasks.
Enterprise-Grade Deployment on Azure
Azure supports enterprise deployment with identity integration, private networking, role-based access control, audit logging, and other compliance mechanisms, enabling applications to run at global scale while meeting security and privacy requirements.
.NET AI Stack
The .NET ecosystem for AI can be understood through four informal categories that clarify when to choose a particular library or approach.
Microsoft AI Extensions
Much like other Microsoft.Extensions packages, they expose common interfaces such as IChatClient, so developers can swap providers - like replacing an OpenAI back end with a local Ollama instance - without changing application code. The central package, Microsoft.Extensions.AI.Abstractions, defines the shared types for chat, embeddings, and function calls, while concrete packages such as Microsoft.Extensions.AI.OpenAI or Microsoft.Extensions.AI.Ollama supply the actual implementations. Helpers like AsChatClient adapt service clients to the interface. Future releases may implement it directly, making the helper unnecessary.
Orchestration frameworks to coordinate multiple models, agents, or data sources
In .NET, the main choices are Semantic Kernel and AutoGen. Semantic Kernel has connectors for many systems. AutoGen focuses on multi-agent workflows. They are useful when an application needs complex prompt routing, chaining of calls, or integration of several AI services, and they can be combined with or substituted for the Microsoft AI Extensions.
Azure AI Services official SDKs for each Azure offering
The most widely used is Azure.AI.OpenAI, which adds Azure-specific features and identity-based authentication on top of the standard OpenAI client. Other libraries target vision, speech, translation, search, and more. These purpose-built services are typically cheaper, more capable in their niche, and expose richer, task-specific APIs than relying on GPT models for everything. Direct use of Azure OpenAI, rather than via the abstraction layer, also provides features that Extensions do not yet surface, such as image or audio generation.
Third-party and self-hosted options
.NET can call any REST-based AI service - the OpenAI client for non-Azure endpoints, Amazon Bedrock, the OlSharp package for a local Ollama server, and vector database libraries such as Qdrant. Connectors in Semantic Kernel and similar frameworks further simplify using these external or on-premises resources, proving that effective AI development in .NET is not limited to Azure.
.NET AI Example Projects
The barriers to experimenting with generative AI in enterprise .NET stacks have dropped. A small proof-of-concept can be online within a day, letting you validate both impact and risks before making larger investments.
This video demonstrates the demo that runs the language model locally in Docker using a tool called Ollama. Running on-premises lowers cloud costs and, more importantly, ensures that no customer data leaves your network — an immediate benefit for privacy, compliance, and latency.
In another example, using the Semantic Kernel library, the presenters demonstrated how they started from an empty console program and, in minutes, turned it into a conversational application that could draw on LLM models.
Coding the feature is quick. What takes time is evaluation, prompt refinement, and building dashboards that grade usefulness, accuracy, and cost on every answer. The company also could need model fine-tuning or complex retraining.
How to build Generative AI applications in .NET
.NET developers can build AI apps fully in .NET now. If they already use C#, they do not have to jump to Python or JavaScript to use modern AI. At the Build conference a few weeks ago, Microsoft showed hands-on labs and live demos proving this point.
Almost everything was recorded and posted online for free. Microsoft’s GitHub holds small, copy-and-paste-ready projects (search, chatbots, agents, etc.), plus one-command Azure deploy scripts.
Here is one more starter kit for adding artificial intelligence features to .NET software. Everything is open source and licensed under the MIT license. The samples show how to plug services such as Azure OpenAI, the public OpenAI API, or locally hosted models into any .NET application. Microsoft.Extensions.AI gives developers the interface for all major AI providers. That design means your teams can experiment, switch vendors, or run models on-premises without rewriting code, and it keeps individual features neatly componentized and easy to test.
A companion library — Microsoft.Extensions.AI.Evaluation — lets teams measure how well a large language model answer meets business quality standards, so you can track accuracy and risk before deploying new AI features.
Ready-made quickstarts cover common use cases such as summarizing text, building a chatbot, or calling custom business functions from natural language, and a recorded Build 2024 session walks through the whole process step by step.
Chat with your Data
“Chat with your Data” is a showcase built in Microsoft’s .NET ecosystem that lets employees question their own documents and receive precise, well-sourced answers instead of generic chatbot replies. The solution pairs OpenAI’s latest large language model with a search index in Azure, so each answer is grounded in your organization’s content rather than the public internet.
The system comes with two lightweight web apps.
The first is the chat interface your staff will use every day. The second is a document manager that business teams can open to upload or revise source files. Behind the scenes, a dashboard called Aspire tracks every running microservice, while Azure Application Insights maps calls between components and flags performance issues. All cloud resources are in a single Azure resource group, making them easy to locate, govern, and, if necessary, de-provision in one step.
A prepared script signs in to Azure, spins up the required services, and returns two URLs: one for chat and one for document management. You choose the subscription and region up front - everything else is automated. The package can be pointed at your existing Azure estate if you prefer to reuse models or search instances already in place.
Uploaded documents are automatically broken into small fragments, embedded as vectors, and stored in Azure AI Search. When a user asks a question, the system looks up the most relevant fragments, feeds them into OpenAI’s GPT-4o model, and delivers a response that cites the source material. This “retrieval-augmented” flow improves accuracy and reduces the risk of hallucination.
The Aspire dashboard gives a snapshot of health and throughput, and Application Insights captures request rates, latencies, and failures for deeper analysis. Together, they offer the end-to-end monitoring enterprise support teams expect.
OpenAI usage is metered by tokens, Search and Application Insights follow pay-as-you-go rules, and Container Apps remain on a low-cost consumption tier by default. Because everything is contained in one resource group, a single delete action — or the supplied “azd down” command — will shut the deployment off and stop charges.
Security is handled through Azure Managed Identity wherever possible, avoiding hard-coded keys. A GitHub Action scans the infrastructure scripts for misconfigurations, and secret scanning is recommended for any downstream forks. If needed, you can also place the container apps behind an internal firewall or virtual network.
For leaders evaluating generative AI pilots, this reference implementation offers a clear view of the architecture, operating model, and cost profile required to make private-data chat a reality, while letting technical teams dig into the code, infrastructure, and observability tooling at their own pace.
eShopLite
Since February 2025, the .NET advocacy group has maintained eShopLite as an e-commerce codebase that demonstrates all currently relevant generative AI patterns.
The repository now contains six fully working variants: vector search on ChromaDB, Azure AI Search, real-time audio inference with DeepSeek R1, agent orchestration over the Model Context Protocol, a pure multi-agent example, and a SQL Server implementation hosted with .NET Aspire.
Every variant includes complete source, infrastructure code, service-graph metadata, and OpenTelemetry tracing. A clone followed by “azd up” deploys the whole stack to Azure, giving teams an out-of-the-box reference they can copy into their own pipelines.
All agent interactions use MCP, the standard published by Anthropic in late 2024. Visual Studio Code and a first-party C# SDK allow engineers to host or consume MCP services without custom code, while Azure AI Foundry extends the same protocol to cross-vendor agent workers. A dotnet new ai-chat” template adds a Blazor front end, Microsoft.Extensions.AI back end, and Aspire health checks in minutes, and can target GitHub Models, Azure OpenAI, plain OpenAI, or a local Ollama endpoint without code changes.
Local execution is handled through two routes.
- Docker Desktop’s Model Runner now hosts GGUF or Ollama models on Windows and macOS, keeping development and production identical when containers move to the cloud.
- The VS Code AI Toolkit can also download and expose a model locally with the same client, so the application code stays unchanged whether it calls GPT-4o in Azure or a laptop-hosted model.
The result is a repeatable, standards-aligned path from prototype to production that lets teams decide at any point whether to run models locally or in Azure, while keeping security, tracing, and compliance artifacts in place.
.NET AI and Machine Learning Case Studies
Below are several examples across different domains, demonstrating tangible outcomes from combining .NET and AI.
Image Recognition and Anomaly Detection
Scancam Industries is a small Australian security and investigations firm that focuses on end-to-end anti-fuel-theft systems for service station operators.
To address the problem, Scancam equips pumps with cameras whose motion sensors raise events whenever a vehicle arrives. An ASP.NET Core endpoint running in Docker receives each event. ML.NET models running in the same process first confirm vehicle presence and then locate any visible license plate region. A specialized recognition engine reads the characters. An Azure Function completes the cloud pipeline by checking the plate against a database of outstanding debts and broadcasting results to iPad and TV displays via SignalR. The attendant’s iPad application, shows every detected plate at each pump and flags known offenders so staff can require prepayment or withhold activation of the nozzle.
Scancam adopted ML.NET after exporting its Custom Vision object detection model to ONNX, replacing a separate Python container and unifying all machine learning code with the existing .NET codebase. ML.NET models are also being deployed for anomaly detection to spot spikes from misconfigured motion zones and dips caused by blocked or misaligned cameras, giving the team proactive insight into hundreds of installations.
Industrial IoT process monitoring and predictive analytics
Evolution Software Design, Inc., a small United States consulting firm has extended its work into hazelnut processing by collaborating with several processors to improve nut quality from harvest through distribution.
In commercial practice, hazelnuts must leave the dryer with 8.5 to 11.5 percent moisture: under-drying leads to mould and spoilage, over-drying causes excessive shrinkage.
Evolution Software addressed these issues with the Hazelnut Monitor application.
During the day, sensors send temperature and humidity numbers to the server, while workers type in the missing facts: when the batch started and finished, its weight, the nut variety, which dryer was used, where the dryer sits and an occasional hand-held moisture reading. At night the system converts every typed word into simple 0-or-1 columns, lines these columns up with the day’s sensor numbers, and feeds the whole table into a learning routine that figures out how the numbers map to the true moisture. The freshly trained model is saved as a small zip file in cloud storage. When the web app starts each morning it loads that zip into memory so every new sensor reading immediately gets a moisture prediction. This cycle—collect, label, retrain, reload—runs every 24 hours.
A web portal built with .NET Core and Aurelia presents real-time predictions alongside raw measurements, and a rules engine hosted in Azure Functions triggers SMS and email notifications when target moisture is reached, when temperatures drift or when sensors fail. Operators can therefore monitor dryers from mobile devices, reduce physical sampling and make timely adjustments.
The model’s job is to guess the nut moisture percentage in real time so workers don’t have to keep pulling hot samples. A few handheld moisture samples are still needed, but far fewer than before, and they are samples the crew already had to take for quality control anyway.
Email Classification Software
SigParser is a United States software company with fewer than one hundred employees. Its API and service automate the labor-intensive and often expensive job of adding to and maintaining customer relationship management systems by extracting names, email addresses, and phone numbers from email signatures and loading that information into CRMs or other databases
A significant operational issue is that many messages entering a customer’s mailbox are automated items such as newsletters, payment notifications, and password reset messages. If these non-human messages were treated as real correspondence, their senders would pollute CRM contact lists. To prevent this, SigParser built a machine learning model that predicts whether a message is “spammy looking,” meaning it originates from an automated source. For example, a notification from a forum’s noreply address is flagged as spammy, so the sender is excluded from the contact database.
Chief executive officer Paul Mendoza moved all training and inference to ML.NET, where models can be trained and tested directly in the production codebase. After adopting ML.NET it now operates six models covering different aspects of email parsing.
The team labeled several thousand of their own messages, classifying each as human or non-human while remaining compliant with the General Data Protection Regulation. The resulting dataset feeds a binary classification pipeline that uses two features: a boolean flag indicating whether the body contains “unsubscribe” or “opt out,” and a cleaned HTML body string that is language agnostic and stripped of personally identifiable information. These features are supplied to a decision tree algorithm. The data is split twenty percent for testing, and the trained model is saved as zip.
The classifier runs in production against millions of emails each month. Its predictions prevent non-human senders from entering customer contact lists and allow SigParser to export accurate contact data automatically, eliminating manual entry errors and delays.
AI-Based Customer Support
Visma Spcs, a Nordic software provider of accounting, HR, payroll, and related services, serves several hundred thousand customers. The company had integrated an “AI Assistant” based on Microsoft Semantic Kernel to improve customer support.
Customer research had shown that users needed to locate information quickly, ask questions and receive correct answers, and obtain links to the relevant documents.
To meet those needs, Visma Spcs implemented a retrieval augmented generation pipeline that queries existing product documentation through Azure AI Search and uses GPT-4 hosted on Azure OpenAI for response generation, with Semantic Kernel handling orchestration inside the company’s .NET stack.
Semantic Kernel was selected because it aligns with the organization’s predominant use of .NET, offers built-in orchestration, agent and automation capabilities required for deep product integration, provides abstraction that allows model substitution as new or specialist LLMs emerge.
The AI Assistant has been deployed to the full customer base. Several percent of daily active users engage with the chat each day, many repeatedly, and roughly 40 percent of all messages arrive outside normal support hours. Internal telemetry shows that about 90 percent of requests receive a satisfactory answer, latency to first reply is consistently a few seconds with variations tied mainly to global API load, and usage levels and quality metrics are trending upward. The assistant also supports newly hired customer success staff when they handle unfamiliar questions.
Health-Related and Clinical Text Classification
Hunter Medical Research Institute (HMRI) is a large Australian healthcare sector organisation . HMRI created a Human-in-the-Loop (HITL) machine learning development framework for clinical research. The framework, built entirely with ML.NET, Visual Studio, SQL Server, ASP.NET Core, and Office 365, enables clinicians to label data, train models, and perform inference without prior programming or machine learning expertise.
Its first use case focused on classifying causes of mortality and hospitalisation arising from extreme heat, and the approach is documented in the publication “A method for rapid machine learning development for data mining with Doctor-in-the-Loop.”
The project addressed the persistent difficulty healthcare institutions face in extracting insights from large volumes of mostly unstructured text despite digitisation. Traditional solutions such as regular expressions, SQL queries, and general purpose NLP tools provided only limited value, while conventional machine learning workflows demanded skills beyond most medical professionals and often produced models that, when left unsupervised, performed poorly in operational settings. HMRI therefore required a system that could incorporate clinicians’ domain expertise directly into the modeling process and yield high-quality results from comparatively small annotated datasets.
ML.NET was selected because it allowed the team to remain entirely within the existing .NET ecosystem, avoiding the technical overhead of integrating non-.NET components and enabling staff to apply their existing knowledge. Using Model Builder, researchers rapidly confirmed that machine learning could solve their classification problem, after which the ML.NET AutoML API automated algorithm selection, pipeline construction, and hyperparameter tuning inside the custom HITL framework.
Clinicians interact with the framework through a web application backed by SQL Server. Initial datasets comprised a 40-year mortality database of roughly 30,000 records and an aeromedical retrieval set of around 13,000 records. Experts first label a test set through the web interface, then trigger server-side ML.NET code to train a model on a small randomly chosen subset. The model assigns predictions and confidence scores to the remaining records, and SQL Server stored procedures immediately compute recall, specificity, and other accuracy metrics against the labeled test set. Results appear in seconds, enabling clinicians to identify additional cases for labeling by reviewing both low confidence predictions and high confidence errors, an active learning strategy that accelerates performance gains.
The resulting models achieved mid- to high-ninety percent accuracy, giving researchers confidence to apply the automated categorizations in ongoing studies. Because training completes quickly and the feedback loop is easy to repeat, the same workflow can be applied efficiently and cost effectively to new classification tasks or additional datasets without compromising accuracy.
Automated Classification of Survey Responses
Brenmor Technologies is a small U.S. healthcare sector firm that supplies patient satisfaction solutions to medical groups and health plan providers. Its core service is a customizable survey system designed to deliver statistically reliable insight into the strengths and weaknesses of clinical encounters. Each survey includes at least one free-text question. Historically, Brenmor staff spent about 16 hours every month manually classifying these comments into topical categories—such as Provider, Staff, Appointments, and Telephone—and assessing sentiment so relevant teams could plan quality improvement measures. The manual workflow was slow, subject to inconsistency, limited to monthly cycles, and produced no confidence scores.
To eliminate these constraints, Brenmor replaced manual labeling with a multiclass text classification model built in ML.NET, Microsoft’s machine learning framework for .NET developers. According to Brenmor’s CTO, successive ML.NET releases have increased both classification speed and accuracy.
The initial training set comprised roughly 3,000 HIPAA-cleansed survey comments.
In operation, the application now classifies responses in real time. Low-confidence predictions are reviewed by staff and added to the training set, and new model versions are stored in source control and deployed automatically through Azure DevOps. Classification accuracy is about 76 percent, and every prediction carries a confidence score. Clients receive topic-segmented feedback immediately and can allocate issues to the appropriate clinical or administrative teams without delay. Developers no longer spend time experimenting with algorithms - instead, they focus on curating higher-quality data.
The company concludes that automating text classification meets the healthcare market’s growing need for near real-time, high-precision analysis of patient comments. This enables medical groups and health plans to act on survey findings more quickly and reliably than before.
Automated Legal Text classification
Williams Mullen is a medium-sized U.S. law firm that focuses on corporate law, litigation, finance, and real estate matters. Attorneys at the firm produce large volumes of unstructured content such as Word files, PDFs, and emails. These documents are stored in a document management system that covers decades of material. Attorneys typically search this data using document metadata. However, the firm found that the metadata for roughly one-fifth of all documents — amounting to millions of files — was missing, inaccurate, or outdated. This deficiency made many documents difficult to retrieve, took up attorney time, and reduced billable work. The cost to correct the metadata manually was estimated in the hundreds of thousands of dollars.
Williams Mullen adopted ML.NET. The solution that was implemented consists of two .NET Core console applications and a database. The first application downloads about two million training documents from the document management system, prepares the data, and trains the model. The second application retrieves production data, loads the trained model, classifies each record, and writes updated metadata back to the database.
By deploying this approach, Williams Mullen corrected metadata issues across millions of documents, restored the ability to search, and improved attorney productivity.
How Belitsoft Can Help
Belitsoft is a .NET development company that brings together GenAI architects, machine learning engineers, and cloud DevOps experts in a single team.
We transform your C# stack into an AI-driven solution that is secure, fast, and flexible enough to run on Azure, on-premises, or with any large language model provider you select.
Recommended posts
Our Clients' Feedback













We have been working for over 10 years and they have become our long-term technology partner. Any software development, programming, or design needs we have had, Belitsoft company has always been able to handle this for us.
Founder from ZensAI (Microsoft)/ formerly Elearningforce