Generative-AI-for-beginners-dotnet
AGENTS.md3.1k starsChanged 9 months agoMITView on GitHub
This repository contains Generative AI for Beginners .NET - a hands-on course teaching .NET developers how to build Generative AI applications. The course focuses on practical, runnable code samples and real-world applications.
- Reads credentials
- Commits and pushes
Trending
Less talk lately.about the whole repository
Who's talking about microsoft/Generative-AI-for-beginners-dotnet
- @adnug.bsky.social“Despite the wet and windy weather, we had a great turnout for our "Move over Python, AI just got a new best …”Bluesky · Jul 10, 2025 · 2 likes
- dotnet-presentations/ai-workshop“Unit 10 - Microsoft Agent Framework essentials (single agent, tools, memory, multi-agent bridge)”GitHub · Jul 26, 2026 · 1 reactions
- @demir-lenk.bsky.social“Really helpful resource about .net with ai. It Help me a lot github.com/microsoft/Ge...”Bluesky · Mar 5, 2025 · 1 likes
- microsoft/generative-ai-with-javascript“Link Checker Report”GitHub · Oct 4, 2026
- microsoft/generative-ai-with-javascript“Link Checker Report”GitHub · Sep 27, 2026
The biggest 5 of 27 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 27
Talked about on GitHub and Bluesky (27 times).
On GitHub · 25
- Jul 26, 2026Unit 10 - Microsoft Agent Framework essentials (single agent, tools, memory, multi-agent bridge) — dotnet-presentations/ai-workshop1 reaction
- Oct 4, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- Sep 27, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- Sep 20, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- Sep 13, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
20 more on GitHub
- Sep 6, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- Aug 30, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- Aug 23, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- Aug 16, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- Aug 9, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- Aug 2, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- Jul 26, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- Jul 19, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- Jul 12, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- Jul 5, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- Jun 28, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- Jun 21, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- Jun 14, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- Jun 7, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- May 31, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- Mar 11, 2026Curso Gen AI 4 Beginners — MarioCodes/dotnet-ai-experiments0 reactions
- Feb 16, 2026Migrate Microsoft AgentFx AI Web Chat App to Fluent UI Blazor and Implement DocAssistant.Charty Architecture (Schema/Examples Memory + SQL Chat + Charting + Security Policies) — YuriyMorozyuk95/DocAssistant.Charty_20 reactions
- Feb 15, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- Feb 15, 2026Link Checker Report — microsoft/generative-ai-with-javascript0 reactions
- Nov 11, 2025Add Microsoft Agent Framework integration with three operational modes — elbruno/251112-netconf25-customavatar0 reactions
On Bluesky · 2
- Jul 10, 2025Despite the wet and windy weather, we had a great turnout for our "Move over Python, AI just got a new best friend! .NET!" event last… — @adnug.bsky.social2 likes and reposts
- Mar 5, 2025Really helpful resource about .net with ai. It Help me a lot github.com/microsoft/Ge... — @demir-lenk.bsky.social1 likes and repost
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository78 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- samples/CoreSamples/.github/copilot-instructions.mdCopilot instructions
- samples/MAF/.github/copilot-instructions.mdCopilot instructions
- samples/MAF/MAF-AIWebChatApp-AG-UI/.github/copilot-instructions.mdCopilot instructions
- samples/MAF/MAF-AIWebChatApp-MutliAgent/.github/copilot-instructions.mdCopilot instructions
- samples/MAF/MAF-AIWebChatApp-Persisting/.github/copilot-instructions.mdCopilot instructions
- samples/MAF/MAF-AIWebChatApp-Simple/.github/copilot-instructions.mdCopilot instructions
- .squad/templates/copilot-instructions.mdCopilot instructions
- agent-collaborationSkill
- coordinator-init-modeSkill
- coordinator-response-modeSkill
- coordinator-source-of-truthSkill
- cross-squad-communicationSkill
- cross-squadSkill
- error-recoverySkill
- git-workflowSkill
- iterative-retrievalSkill
- reflectSkill
- reviewer-protocolSkill
- secret-handlingSkill
- session-recoverySkill
- squad-conventionsSkill
- squad-helpSkill
- squadSkill
- squad-version-checkSkill
- test-disciplineSkill
- tiered-memorySkill
- {skill-name}Skill
- agent-collaborationSkill
- agent-conductSkill
- architectural-proposalsSkill
- ci-validation-gatesSkill
- client-compatibilitySkill
- cli-wiringSkill
- coordinator-init-modeSkill
- coordinator-response-modeSkill
- coordinator-source-of-truthSkill
- cross-machine-coordinationSkill
- cross-squad-communicationSkill
- cross-squadSkill
- distributed-meshSkill
- docs-standardsSkill
- e2e-template-testingSkill
- economy-modeSkill
- error-recoverySkill
- external-commsSkill
- fact-checkingSkill
- gh-auth-isolationSkill
- github-multi-accountSkill
- git-workflowSkill
- history-hygieneSkill
- humanizerSkill
- init-modeSkill
- iterative-retrievalSkill
- model-selectionSkill
- napSkill
- notification-routingSkill
- personal-squadSkill
- project-conventionsSkill
- pr-review-responseSkill
- The first 60 shown.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
37 rules. About 1 is common, 22 are distinctive, and 14 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈22
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Centralized samples: All code samples live in the samples/ directory, organized by category
- Distinctive: line 112
Create a new Codespace from your fork
- Distinctive: line 114
Default: .NET 10 with Azure CLI and GitHub CLI
- Very specific: line 280
No repository/org/cloud secrets are used anywhere in this workflow, and nothing secret is ever printed.
- Distinctive: line 342
Use modern .NET features (top-level statements, nullable reference types, file-scoped namespaces)
- Distinctive: line 343
Follow standard C# naming conventions (PascalCase for classes/methods, camelCase for locals)
- Distinctive: line 344
Use async/await patterns for I/O operations
- Distinctive: line 345
Prefer dependency injection over static instances
- Very specific: line 346
Use IChatClient abstraction (Microsoft.Extensions.AI) for AI model integration
- Common: line 350
Never hardcode API keys: - use user secrets or environment variables
- Very specific: line 358
Place sample code in the samples/ directory under the appropriate category
- Distinctive: line 360
Keep README files in lesson root directories
- Distinctive: line 361
Use descriptive file names with English characters, numbers, and dashes
- Very specific: line 365
All URLs must be wrapped in text format
- Very specific: line 367
Add tracking IDs to Microsoft/GitHub URLs: ?wt.mc_id= or &wt.mc_id=
- Very specific: line 368
No country-specific locales in URLs (avoid /en-us/)
- Distinctive: line 369
Update relevant lesson README.md files when modifying code
- Very specific: line 412
Format your code: Run dotnet format on all modified projects
- Very specific: line 413
Build verification: Ensure dotnet build succeeds for affected solutions
- Distinctive: line 414
Test manually: Run and verify sample applications work as expected
- Distinctive: line 420
Fork the repository: before making changes
- Distinctive: line 440
Use descriptive titles that clearly indicate the change:
- Very specific: line 450
Missing SDK: Ensure .NET 10 SDK is installed (dotnet --version)
- Very specific: line 451
Workload issues: Run dotnet workload update
- Very specific: line 452
Package restore fails: Delete bin/ and obj/ folders, then dotnet restore
- Very specific: line 455
Azure OpenAI: Check user secrets are configured: dotnet user-secrets list
- Very specific: line 456
Ollama: Ensure service is running and model is pulled: ollama list
- Distinctive: line 459
Port forwarding: Ensure port 17057 is forwarded for web applications
- Distinctive: line 461
Ollama in Codespaces: Use the Ollama dev container configuration
- Distinctive: line 468
Review .gitignore: before committing to exclude sensitive files
- Distinctive: line 474
Batch operations: Use streaming responses for better UX
- Distinctive: line 475
Caching: Consider caching AI responses for repeated queries
- Distinctive: line 480
Only contribute translations in languages where you are proficient
- Distinctive: line 481
Do not use machine translation
- Distinctive: line 483
Update the translation table in README.md with the date
- Distinctive: line 529
Add links to official documentation for deeper learning
- Distinctive: line 530
Keep explanations accessible to .NET developers new to AI
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
Project Overview
This repository contains Generative AI for Beginners .NET - a hands-on course teaching .NET developers how to build Generative AI applications. The course focuses on practical, runnable code samples and real-world applications.
Architecture
- Lesson-based structure: Organized in numbered folders (01-05) containing lesson documentation
- Centralized samples: All code samples live in the
samples/directory, organized by category - Multi-language support: Course materials translated into 8 languages (located in
translations/) - Sample applications: Full-featured AI-powered apps demonstrating practical GenAI integration
- Key technologies: .NET 10+, Microsoft.Extensions.AI (MEAI), Microsoft Agent Framework, Azure OpenAI, Ollama
Project Structure
.
├── 01-IntroductionToGenerativeAI/ # Introduction to Generative AI + setup guides
├── 02-GenerativeAITechniques/ # Text completions, streaming, function calling, middleware
├── 03-AIPatternsAndApplications/ # Embeddings, RAG, vision, combining patterns
├── 04-AgentsWithMAF/ # Microsoft Agent Framework + MCP
├── 05-ResponsibleAI/ # Responsible AI practices
├── samples/
│ ├── CoreSamples/ # Core technique samples (chat, vision, RAG, functions, etc.)
│ │ └── CoreGenerativeAITechniques.sln
│ ├── MAF/ # Microsoft Agent Framework samples (25+ projects)
│ │ └── MAF-Demos.slnx
│ ├── AppsWithGenAI/ # Full AI-powered applications
│ │ ├── SpaceAINet/ # AI-powered Space Battle game
│ │ ├── HFMCP.GenImage/ # Image generation Aspire app
│ │ └── ConsoleGpuViewer/ # GPU viewer console app
│ └── PracticalSamples/ # Aspire MCP sample
│ └── Aspire.MCP.Sample.sln
├── infra/ # Azure Bicep infrastructure
├── translations/ # Localized course materials (8 languages)
└── images/ # Course branding assets
Each lesson folder contains:
- readme.md: Lesson documentation with step-by-step guidance
- images/: Visual assets
- Setup guides (in lesson 01)Setup Commands
Prerequisites
- .NET 10 SDK or later
- Access to at least one AI provider:
- Azure OpenAI (requires Azure subscription)
- Ollama (for local model execution)
Initial Setup
# Clone the repository
git clone https://github.com/microsoft/Generative-AI-for-beginners-dotnet.git
cd Generative-AI-for-beginners-dotnet
# Verify .NET installation
dotnet --version # Should be 10.0 or higherAI Provider Setup
Azure OpenAI
# Navigate to a project and set user secrets
cd <project-path>
dotnet user-secrets set "AZURE_OPENAI_ENDPOINT" "<your-endpoint>"
dotnet user-secrets set "AZURE_OPENAI_MODEL" "<your-model-name>"
dotnet user-secrets set "AZURE_OPENAI_APIKEY" "<your-api-key>"Ollama (Local Models)
# Install Ollama from https://ollama.com/download
# Pull required models (example for lesson 02)
ollama pull phi4-mini
# Pull models for RAG samples (lesson 03)
ollama pull phi4-mini
ollama pull all-minilm
# Verify Ollama is running (default: http://localhost:11434)
curl http://localhost:11434/api/versionInstalling Dependencies
# Restore dependencies for a specific solution
dotnet restore <path-to-solution>.sln
# Example: Restore core samples
dotnet restore samples/CoreSamples/CoreGenerativeAITechniques.sln
# Restore MAF samples
dotnet restore samples/MAF/MAF-Demos.slnx
# Restore Aspire MCP sample
dotnet restore samples/PracticalSamples/Aspire.MCP.Sample.slnDevelopment Workflow
GitHub Codespaces (Recommended)
- Fork this repository to your GitHub account
- Create a new Codespace from your fork
- Select the appropriate dev container:
- Default: .NET 10 with Azure CLI and GitHub CLI
- Ollama: Includes Ollama for local model execution
- The postCreateCommand will automatically set up .NET workloads and trust dev certificates
Local Development
# Start a sample project
cd <project-directory>
dotnet run
# Example: Run basic chat sample with MEAI
cd samples/CoreSamples/BasicChat-01MEAI
dotnet run app.cs
# Example: Run with Ollama
cd samples/CoreSamples/BasicChat-03Ollama
dotnet runWorking with Sample Applications
SpaceAINet (AI-powered game)
cd samples/AppsWithGenAI/SpaceAINet/SpaceAINet.Console
dotnet build
dotnet run
# In-game controls:
# A - Toggle Azure OpenAI mode
# O - Toggle Ollama mode
# F - Show FPS
# S - Save screenshotAspire MCP Sample
cd samples/PracticalSamples/src
dotnet run --project McpSample.AppHost/McpSample.AppHost.csprojHot Reload and Watch Mode
# Run with hot reload (for web projects)
dotnet watch run
# Build in watch mode
dotnet watch buildTesting Instructions
Build Validation
The repository uses GitHub Actions for CI/CD validation. Before submitting changes:
# Restore dependencies
dotnet restore <solution-path>
# Build in Release mode (as CI does)
dotnet build <solution-path> --no-restore --configuration Release --verbosity minimal
# Example: Validate core samples
dotnet restore samples/CoreSamples/CoreGenerativeAITechniques.sln
dotnet build samples/CoreSamples/CoreGenerativeAITechniques.sln --no-restore --configuration ReleaseValidated Solutions
The following solutions are validated in CI:
samples/CoreSamples/CoreGenerativeAITechniques.slnsamples/PracticalSamples/Aspire.MCP.Sample.slnsamples/AppsWithGenAI/HFMCP.GenImage/HFMCP.GenImage.slnsamples/AppsWithGenAI/SpaceAINet/SpaceAINet.slnsamples/MAF/MAF-Demos.slnx
Validated File-Based app.cs Samples
In addition to the solution matrix above, .github/workflows/build-validation.yml runs a
secret-free discover-file-based-apps / compile-file-based-apps job pair that:
- Discovers every tracked
samples/**/app.csfile withgit ls-files(no manual list to keep in sync). - Compiles each one independently with
dotnet build <path>(no run, no credentials, no Ollama). - Uses
fail-fast: falseso every sample reports its own pass/fail, named by its path.
To intentionally exclude a sample from this check (for example, a future OS-specific or
credential-only file-based app), add its exact git ls-files path to the EXCLUDED_SAMPLES
array in the Discover tracked app.cs samples step, with a comment explaining why. This list is
empty today — every tracked file-based sample must compile secret-free.
Ollama Smoke Validation (opt-in, workflow_dispatch only)
Compilation alone cannot catch runtime-only regressions in the OllamaSharp integration (see
the serialization bug fixed by #528, which only surfaced on the first live model call).
.github/workflows/ollama-smoke-validation.yml closes that gap with a manually triggered
workflow — it has no push/pull_request trigger, so it never runs automatically and never
adds a model download to normal PR validation. Trigger it from the Actions tab
(Ollama Smoke Validation (opt-in) → Run workflow) or with
gh workflow run ollama-smoke-validation.yml.
Sample scope — exactly three file-based samples are exercised, each covering a distinct OllamaSharp code path:
samples/CoreSamples/BasicChat-03Ollama/app.cs— single-turn request path, run exactly as committed.samples/CoreSamples/BasicChat-10ConversationHistory/app.cs— run with no Azure user-secrets configured, so the sample's own fallback logic (already in the committed source) selects the local Ollama client. Two questions are piped over stdin to exercise the streaming (GetStreamingResponseAsync) and multi-turn conversation-history paths in one run.samples/CoreSamples/BasicChat-07Ollama-gpt-oss/app.cs— the tracked file is never modified. The workflow copies it to a runner-local$RUNNER_TEMPdirectory and only there substitutes the model tag before compiling/running the copy (see Substitution policy below). The workflow step verifies withgit diff --quietthat the tracked source is untouched.
Install policy — Ollama is installed from a pinned, versioned GitHub release asset
(ollama-linux-amd64.tgz for release v0.12.11), never from curl https://ollama.com/install.sh
| sh. The download is verified against a hardcoded SHA-256 digest (taken from that release's own
sha256sum.txt and independently confirmed by hashing the downloaded artifact) using
sha256sum --check --strict before the archive is ever extracted; a digest mismatch aborts the
job without extracting anything. The archive is unpacked into a runner-local temp directory and
never installed as a system service, so nothing is ever executed as root or outside the job's own
temp workspace. To move to a newer Ollama release, update OLLAMA_RELEASE_VERSION,
OLLAMA_RELEASE_ASSET, and OLLAMA_RELEASE_SHA256 together in the workflow, re-deriving the
digest from that release's own sha256sum.txt.
Model policy — the workflow pulls a single fixed pinned model, phi4-mini, defined once as
the OLLAMA_MODEL workflow constant. It is not exposed as a workflow_dispatch input:
allowing an arbitrary operator-supplied model tag would let an unpinned, unpulled model silently
invalidate every assertion in this workflow (word-count thresholds, fallback-label check,
context-carryover check) and would also select which model the BasicChat-07Ollama-gpt-oss temp
copy substitutes in, defeating that step's own policy below. To test a different tag, change
OLLAMA_MODEL in the workflow and this policy text together.
Substitution policy & model-tag drift risk — BasicChat-07Ollama-gpt-oss is written against
gpt-oss:20b, a much larger reasoning model that isn't practical to pull on a hosted runner
within a bounded timeout. The workflow's temp copy substitutes the pinned OLLAMA_MODEL
(phi4-mini) in place of gpt-oss:20b, which only proves the OllamaSharp request path (client
construction, serialization, response parsing) works end-to-end — it does not validate
gpt-oss:20b-specific reasoning quality or behavior. If OllamaSharp ever regresses in a way
that's specific to larger/reasoning models, this substitution would not catch it; treat a green
run here as evidence for the shared client/serialization path only, not as a claim about
gpt-oss:20b itself.
Timeout behavior — every step is individually bounded so a hang fails fast with a clear
step name instead of consuming the whole job budget: the pinned-release download is capped by
curl --connect-timeout 10 --max-time 120, readiness polling combines a 60s outer bound
(30 attempts × 2s) with a per-request curl --connect-timeout 2 --max-time 5, the model pull is
capped at 900s via timeout, and each sample run at 180s via timeout. The job itself has a
30-minute timeout-minutes ceiling. Step names and GITHUB_STEP_SUMMARY entries distinguish
Ollama install/readiness/model-pull failures from sample-level regressions, and the Ollama
daemon is stopped best-effort in an if: always() cleanup step regardless of outcome.
Least privilege — the workflow declares permissions: contents: read at the top level (no
broader default token permissions), and the checkout step sets persist-credentials: false so
the job's GITHUB_TOKEN credential is never written to disk for later steps to pick up.
Assertions — a sample only passes if it exits 0 and produces a model response of
meaningful length (≥15 words) with no exception/serialization-error signatures in its output;
for BasicChat-10ConversationHistory the check additionally confirms the Ollama fallback label
was printed (proving no Azure secrets were picked up), parses the first and second streamed
responses out of the exact piped-stdin output shape and validates each independently for
substantive content (≥3 words), and checks that only the second response references the
first question's topic (france|paris|capital) — proving conversation history was actually
carried across turns, not just that the process exited cleanly or that the transcript as a whole
happens to mention the topic somewhere.
No repository/org/cloud secrets are used anywhere in this workflow, and nothing secret is ever printed.
Release Workflow (workflow_dispatch only)
.github/workflows/squad-release.yml is the only release automation in this repository — it has
no push trigger and requires manual dispatch from the Actions tab against main. See
docs/releases/README.md for the full tag convention, notes policy, and dry-run-first procedure.
Key points for maintainers:
- The workflow fails closed unless dispatched with
mainselected, and re-verifies via the GitHub API that the dispatched commit is still the current tip ofmainbefore doing any validation work, so a stale UI selection or a race with a fresh push is caught immediately. tagandnotes_pathinputs are strictly validated (calendar-validYYYY-MM-DD; a singledocs/releases/<name>.mdfile, no traversal/absolute paths/symlink escape) before anything else runs.- Validation reuses
.github/workflows/build-validation.ymlviaworkflow_call, pinned to the exact captured SHA (refinput) — the same five Release solution builds, six tests, and 13 file-basedapp.cscompiles used for PR validation, with no separate matrix to keep in sync. dry_run(defaulttrue) runs every validation and duplicate-tag/release check and prints the proposed SHA/tag/notes/latest plan, but creates nothing. Only a second dispatch withdry_run: falsecan publish, and only after validation succeeds again against the same captured SHA.- Publishing uses
gh release create --target <sha>(not a separategit tag+ push), so tag creation and release publication happen as a single API-driven step — there is no window where a tag exists with no matching release.dotnet pack/NuGet publishing is intentionally out of scope and not implemented anywhere in this workflow.
Manual Testing
# Test a specific project
cd <project-directory>
dotnet run
# Verify AI integration works with your provider
# Follow the lesson-specific README instructions for testing AI featuresNote on Test Coverage
This repository is primarily educational with sample applications. There are currently no automated unit or integration tests. Validation is done through:
- Build verification in CI
- Manual testing of sample applications
- Documentation review
Code Style and Conventions
Formatting
# Format code before committing (REQUIRED)
dotnet format
# Verify formatting without making changes
dotnet format --verify-no-changes
# Format a specific solution
dotnet format <path-to-solution>.slnC# Conventions
- Use modern .NET features (top-level statements, nullable reference types, file-scoped namespaces)
- Follow standard C# naming conventions (PascalCase for classes/methods, camelCase for locals)
- Use async/await patterns for I/O operations
- Prefer dependency injection over static instances
- Use
IChatClientabstraction (Microsoft.Extensions.AI) for AI model integration
AI Integration Patterns
- Never hardcode API keys - use user secrets or environment variables
- Abstract AI providers behind service classes for easy swapping
- Use IChatClient from Microsoft.Extensions.AI for provider-agnostic code
- Microsoft Agent Framework for advanced agent orchestration and multi-agent workflows
- Support multiple providers (Azure OpenAI, Ollama) where applicable
File Organization
- Place sample code in the
samples/directory under the appropriate category - Store images in
<lesson-number>/images/or rootimages/folder - Keep README files in lesson root directories
- Use descriptive file names with English characters, numbers, and dashes
Documentation Standards
- All URLs must be wrapped in
[text](url)format - Relative links start with
./(current dir) or../(parent dir) - Add tracking IDs to Microsoft/GitHub URLs:
?wt.mc_id=or&wt.mc_id= - No country-specific locales in URLs (avoid
/en-us/) - Update relevant lesson README.md files when modifying code
Build and Deployment
Build Commands
# Standard build
dotnet build
# Release build (as used in CI)
dotnet build --configuration Release
# Build specific solution
dotnet build <path-to-solution>.sln.NET Workloads
The dev container automatically installs required workloads. For local development:
# Update workloads
dotnet workload update
# List installed workloads
dotnet workload list
# Trust development certificates
dotnet dev-certs https --trustDeployment Notes
- Sample projects are designed for local execution and learning
- For production deployment, follow Azure deployment best practices
- Aspire projects can be deployed to Azure Container Apps
- Refer to individual project READMEs for specific deployment instructions
Pull Request Guidelines
Before Submitting a PR
- Format your code: Run
dotnet formaton all modified projects - Build verification: Ensure
dotnet buildsucceeds for affected solutions - Test manually: Run and verify sample applications work as expected
- Update documentation: Modify lesson READMEs if changing functionality
- Translation considerations: For content changes, create separate PRs per language
PR Requirements
- Fork the repository before making changes
- One change per PR: Separate bug fixes, features, and documentation updates
- No partial translations: Submit complete translations for all files in a language
- Keep main branch updated: Rebase if there are merge conflicts
- CLA required: Contributors must agree to Microsoft's Contributor License Agreement
Commit Message Format
<type>: <brief description>
Examples:
- docs: Update Azure OpenAI setup instructions
- feat: Add new RAG sample with vector search
- fix: Correct null reference in chat service
- style: Apply dotnet format to all projectsPR Title Format
Use descriptive titles that clearly indicate the change:
docs: Update lesson 02 for .NET 10 compatibilityfeat: Add Agent Framework orchestration samplefix: Resolve build errors in SpaceAINet project
Additional Notes
Common Issues and Solutions
Build Errors
- Missing SDK: Ensure .NET 10 SDK is installed (
dotnet --version) - Workload issues: Run
dotnet workload update - Package restore fails: Delete
bin/andobj/folders, thendotnet restore
AI Provider Issues
- Azure OpenAI: Check user secrets are configured:
dotnet user-secrets list - Ollama: Ensure service is running and model is pulled:
ollama list
Codespace-Specific
- Port forwarding: Ensure port 17057 is forwarded for web applications
- Memory limits: Codespace requires 16GB RAM for optimal performance
- Ollama in Codespaces: Use the Ollama dev container configuration
Security Considerations
- Never commit secrets to source control
- Use user secrets for local development:
dotnet user-secrets set - Environment variables for production/Codespaces
- Review .gitignore before committing to exclude sensitive files
Performance Tips
- Local models (Ollama): Require significant CPU/GPU resources
- Cloud models: Faster but require network connectivity
- Batch operations: Use streaming responses for better UX
- Caching: Consider caching AI responses for repeated queries
Multi-Language Support
Translations are maintained in translations/<language-code>/:
- Only contribute translations in languages where you are proficient
- Do not use machine translation
- Submit complete translations (all files) in a single PR
- Update the translation table in README.md with the date
Project-Specific Context
Lesson 01: Introduction to Generative AI
- What generative AI is, why .NET is a first-class citizen for AI
- Setup guides for Azure OpenAI and Ollama
- GitHub Codespaces configuration
Lesson 02: Generative AI Techniques
- Text completions, chat conversations, streaming, structured output
- Function calling and middleware pipeline
- Core samples: BasicChat-01MEAI, BasicChat-03Ollama, MEAIFunctions
Lesson 03: AI Patterns and Applications
- Embeddings and semantic search
- RAG (Retrieval-Augmented Generation) with vectors
- Vision and document understanding
- Combining AI patterns, local model runners
Lesson 04: Agents with MAF
- Building first agent with Microsoft Agent Framework
- Agents with tools, multi-agent workflows
- Model Context Protocol (MCP) integration
- 25+ MAF sample projects
Lesson 05: Responsible AI
- Identifying and mitigating bias
- Content safety, guardrails, transparency
- Ethical considerations for agentic systems
Sample Applications (samples/AppsWithGenAI/)
- SpaceAINet: AI-powered retro Space Battle game (created with Copilot Agent)
- HFMCP.GenImage: Image generation Aspire app with HuggingFace MCP
- ConsoleGpuViewer: GPU monitoring console app
Practical Samples (samples/PracticalSamples/)
- Aspire MCP sample demonstrating Model Context Protocol
- Multi-project Aspire solution with Blazor chat UI
- Integration with external MCP servers
Contributing to Documentation
When updating documentation:
- Maintain consistent formatting across all READMEs
- Include code examples where helpful for beginners
- Add links to official documentation for deeper learning
- Keep explanations accessible to .NET developers new to AI
Resource Links
For more information, refer to:
- README.md - Course overview and lesson map
- CONTRIBUTING.MD - Detailed contribution guidelines
- Individual lesson READMEs for specific topics and samples
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

