Repository navigation
.NET: Correct sample READMEs about missing environment variables - #9732
Draft
Naveen Chatlapalli (1aifanatic) wants to merge 1 commit into
Draft
Naveen Chatlapalli (1aifanatic) wants to merge 1 commit into
Naveen Chatlapalli (1aifanatic) wants to merge 1 commit into
Conversation
Six READMEs said the samples prompt for unset environment variables. None of them do: every sample reads its settings with GetEnvironmentVariable(...) ?? throw and stops with an error naming the missing variable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Naveen Chatlapalli (1aifanatic)
temporarily deployed
to
github-app-auth
October 26, 2026 18:36 — with
GitHub Actions
Inactive
Naveen Chatlapalli (1aifanatic)
temporarily deployed
to
github-app-auth
October 26, 2026 18:36 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The six documentation-only corrections match the reported sample validation behavior, with no unresolved findings.
No open issues 🎉
What changed in this PR
Corrects six .NET sample READMEs to describe existing behavior when required environment variables are missing.
Changes:
- Removes incorrect claims that samples prompt for missing values.
- Clarifies that samples stop with an error naming the missing variable.
- Changes documentation only; runtime behavior is unchanged.
| File | Description |
|---|---|
dotnet/samples/02-agents/ModelContextProtocol/README.md |
Corrects missing-variable guidance for MCP samples. |
dotnet/samples/02-agents/AgentWithRAG/AgentWithRAG_Step02_CustomVectorStoreRAG/README.md |
Corrects missing-variable guidance for custom vector-store RAG. |
dotnet/samples/02-agents/Agents/README.md |
Corrects missing-variable guidance for agent samples. |
dotnet/samples/02-agents/AgentProviders/README.md |
Corrects shared provider setup guidance. |
dotnet/samples/02-agents/AgentProviders/anthropic/README.md |
Corrects missing-variable guidance for Anthropic samples. |
dotnet/samples/02-agents/A2A/README.md |
Corrects missing-variable guidance for A2A samples. |
Review effort: Balanced
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
Six .NET sample READMEs end their environment variable setup with "If the variables are not set, you will be prompted for the values when running the samples." None of these samples prompt. Each reads its settings with
GetEnvironmentVariable(...) ?? throw new InvalidOperationException(...)and stops. The onlyConsole.ReadLinecalls in these folders are for chat input and tool approvals.Description & Review Guide
02-agents/Agents/README.md02-agents/A2A/README.md02-agents/AgentProviders/README.md02-agents/AgentProviders/anthropic/README.md02-agents/ModelContextProtocol/README.md02-agents/AgentWithRAG/AgentWithRAG_Step02_CustomVectorStoreRAG/README.mdI checked that every throw on a missing variable in these folders names the variable (for example
FOUNDRY_PROJECT_ENDPOINT is not set.,Please set the GOOGLE_GENAI_API_KEY environment variable.). TheModelContextProtocoledit is 10 lines below the line #9581 changes, so the two do not conflict.Related Issue
N/A - trivial change: the READMEs describe a prompt that the samples do not implement, and the actual behavior is unambiguous from the code.
AI Assistance
AI assistance details: Claude Code helped compare the README claims with the samples' code, make the edits, and draft this description.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.🤖 Generated with Claude Code