Fix shebang recommendation in file-based apps docs#53566
Merged
Conversation
Agent-Logs-Url: https://github.com/dotnet/docs/sessions/686c76cc-7134-414a-84d4-cc62a14aa6c1 Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix shebang recommendation in file based apps document
Fix shebang recommendation in file-based apps docs
May 5, 2026
jjonescz
approved these changes
May 6, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates file-based app documentation and snippets to recommend a shebang that reliably forwards command-line arguments to the app (instead of letting dotnet consume arguments like --help).
Changes:
- Updated shebang examples to
#!/usr/bin/env -S dotnet --in the C# tutorial, the SDK docs, and a referenced snippet. - Added explanation in the SDK docs for why
-Sand--are needed for correct argument forwarding. - Added a fallback note for systems that don’t support
env -S.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docs/csharp/fundamentals/tutorials/snippets/file-based-programs/AsciiArt.cs | Updates the executable shebang in the tutorial snippet to use env -S and -- for correct arg forwarding. |
| docs/csharp/fundamentals/tutorials/file-based-programs.md | Updates the tutorial’s shebang guidance and adds a tip about fallbacks. |
| docs/core/sdk/file-based-apps.md | Updates the shebang recommendation and documents the --/-S rationale plus a fallback note. |
Agent-Logs-Url: https://github.com/dotnet/docs/sessions/10366416-b55e-4b2e-b4ae-0cc021c5c14e Co-authored-by: adegeo <67293991+adegeo@users.noreply.github.com>
adegeo
approved these changes
May 11, 2026
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.
docs/core/sdk/file-based-apps.mdShell Execution section:#!/usr/bin/env dotnetto#!/usr/bin/env -S dotnet ---Sflag and--separator, leading with reason/purpose#!/usr/bin/env dotnetcan be used if-Sisn't supporteddocs/csharp/fundamentals/tutorials/file-based-programs.md:-Sdescription to accurately say it passesdotnetand--as separate arguments, while keeping focus on the practical effectInternal previews