Skip to content

docs: add notes for running on .NET 11 - #203

Open
carldebilly wants to merge 2 commits into
mainfrom
dev/cdb/net11-docs
Open

carldebilly wants to merge 2 commits into
mainfrom
dev/cdb/net11-docs

Conversation

@carldebilly

@carldebilly carldebilly commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Closes #182.

Adds docs/dotnet-11.md ("Running on .NET 11"), linked from the README, from docs/for-coding-agents.md (under the MCP client configuration and in the reading list) and from the MCP publishing section, whose dnx example now pins the package version. docs/shell-completion.md corrects how completion setup behaves when started through dotnet. A test pins that shell completion setup accepts a dotnet living in a dotnetup folder.

Observations (SDK 11.0.100)

Probes live outside the repo; Linux checks ran in mcr.microsoft.com/dotnet/sdk:11.0, with script -qec to give the process a pseudo-terminal.

C# 15. public union U(int, string); compiles and runs in a net11.0 project with the default language version; the same file fails in net10.0 (CS0106, CS1001).

FORCE_COLOR.

  • Microsoft.Extensions.Logging.Console 11.0.0, AddSimpleConsole(), stdout redirected (Linux): no SGR without the variable; SGR with FORCE_COLOR=1, FORCE_COLOR=0, and FORCE_COLOR=1 NO_COLOR=1. On a terminal, NO_COLOR=1 removes the colour and NO_COLOR=1 FORCE_COLOR=1 restores it. Source: ConsoleUtils.GetColorOverrideFromEnvironment on release/11.0.
  • Console.ForegroundColor + Console.Write with stdout redirected: no escape bytes for any combination of FORCE_COLOR/NO_COLOR, on Windows and on Linux.

dotnet watch.

  • A probe started by dotnet watch run reports stdin/stdout/stderr not redirected and DOTNET_WATCH=1, in a real Windows console (Start-Process) and under a Linux PTY.
  • Keys (Linux PTY): 5 bursts of abcdefghij written to the terminal while the app's Console.ReadKey loop was running: 0 keys received under dotnet watch run, 0 under dotnet watch --non-interactive run; 10/10 under dotnet run. dotnet-watch's PhysicalConsole runs its own Console.ReadKey(intercept: true) loop when stdin is not redirected (release/11.0.1xx).
  • Not yet observed: key delivery on Windows.

dotnet run -e. dotnet run -e PROBE_VALUE=from-e reaches the app on Windows and Linux.

dotnetup 0.3.0-preview.1.

  • Default installation root, from dotnetup dotnet with nothing installed: %LOCALAPPDATA%\dotnetup\dotnet (Windows), ~/.local/share/dotnetup/dotnet (Linux). Access modes and defaults from learn.microsoft.com (public preview).
  • Windows: dotnetup install 11.0 --untracked --install-path <dir> leaves user PATH and DOTNET_ROOT unchanged; with a PATH holding no dotnet, where dotnet/where dnx find nothing; <dir>\dotnet.exe dnx --help and <dir>\dnx.cmd --help work. dotnetup was removed afterwards.
  • Linux, dotnetup as the only installation (/usr/share/dotnet moved away): dotnet and dnx not on PATH; <root>/dotnet dnx -y ToolProbe --add-source <local feed> -- mcp serve runs the tool without DOTNET_ROOT; the installed global-tool shim fails with "You must install .NET to run this application" and runs with DOTNET_ROOT=<root>; a published framework-dependent apphost behaves the same.

dnx (SDK 11 container, only runtime 11.0.0). dnx accepts Id@version; on a first run it writes nothing to stdout but the tool's own output. A net10.0 tool exits 150 with "You must install or update .NET to run this application"; it runs on 11.0.0 with dnx -y --allow-roll-forward Id@version, and as a global tool with DOTNET_ROLL_FORWARD=Major. dnx -y also parses on SDK 10.0.404. dotnet publish -c Release -r linux-x64 --self-contained works on a PackAsTool project, and the output runs with no .NET installed.

Shell completion. ShellCompletionHostValidator compares file names only; the new test uses dotnetup host paths. A setup started as dotnet myapp.dll writes a PowerShell completer registered for dotnet as well as the app, which runs dotnet completion __complete without the DLL (reproduced by the review). docs/shell-completion.md now says to set up from the app's own executable and how to repair such a setup; the adapter defect predates this PR and is not fixed here.

Not in this PR

The matching page on yllibed/repl-website (hand-written pages), which the issue asks for.

A new page, docs/dotnet-11.md, records what was checked with the .NET SDK
11.0.100: C# 15 by default for net11.0 and union results; FORCE_COLOR in the
console logger, which Repl matches, and Console.ForegroundColor, which writes
no colour to a redirected stream; dotnet watch, which leaves the streams
attached but keeps the keyboard, so the interactive loop belongs to dotnet run;
dotnet run -e; and dotnetup per-user installs, where an agent host outside the
user's shell finds neither dotnet nor dnx, with three working configurations.

The README, docs/for-coding-agents.md and the MCP publishing section link to
it. A test pins that shell completion recognises a dotnet installed in a
dotnetup folder, since it compares file names only.

Closes #182.
@carldebilly carldebilly added this to the 0.12.1 milestone Nov 11, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T15:14:39.276974Z 93e76e8 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@autocarl autocarl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested on exact head 219d6a6, base/merge-base 0c9e0af. One introduced P2 documentation claim confirmed by real PowerShell execution with direct-bridge and apphost positive controls; see inline. Independent read-only review covered all five changed files. No product-source changes made.

Validation: warning-as-error Release unit-test project/dependency build passed after correcting the diagnostic clones local origin URL for SourceLink (initial build failed on that review-environment issue); 8 host-validator tests per target passed on net10.0 and net11.0, 16 total, no failures/skips. SDK 11.0.100 Linux probes reproduced default-language union compilation (net10 control rejected the same declaration), dotnet run -e environment propagation, logger FORCE_COLOR nonempty/0/NO_COLOR precedence and no redirected ForegroundColor escapes. Real PTY run delivered 10/10 keys; watch and watch --non-interactive delivered 0/10, all with nonredirected standard streams. New local Markdown targets/anchors checked. Applicable CI rechecked green before publication. Windows observations and isolated dotnetup runtime discovery were not independently rerun locally; installer access-mode guidance was cross-checked against official documentation. No full-solution local rebuild.

Separate scope note: PR explicitly defers the matching repl-website page, while #182 requires it. Track that follow-up before considering the whole issue complete; not treated as an introduced code defect here.

Comment thread docs/dotnet-11.md Outdated
Comment on lines +94 to +97
Setting up shell completion works with a dotnetup `dotnet`: the setup check compares executable file names,
not folders. For an application started through `dotnet` rather than its own executable, PowerShell
completion keeps the full path of the `dotnet` that ran the setup, and stops answering if `dotnet` later
resolves to another installation; run the setup again after switching.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Do not promise working PowerShell completion for a DLL launched through dotnet

This paragraph presents completion as working with the original dotnet and needing setup again only after switching installations, but the generated completer already fails before any switch. The new test establishes validator acceptance, not operational completion.

Reproduced on Linux with PowerShell using Repl.Core from this exact checkout and the unmodified BuildManagedBlock output: a tiny app maps alpha; the direct dotnet Probe.dll completion __complete bridge returns alpha. Registering the block generated while launched via dotnet Probe.dll, then calling CommandCompletion.CompleteInput on dotnet al, instead returns dotnet diagnostic text (dotnet-completion does not exist), not alpha. Completing Probe al returns nothing. Generating the block via the very same applications own apphost makes Probe al return alpha. No installation was switched.

The generated block pins Environment.ProcessPath to dotnet, but invokes $invokedCommand completion __complete without the application DLL. The registered app name instead resolves to the apphost and fails the pinned-dotnet path comparison. Rerunning setup against another SDK cannot fix either issue. This runtime limitation predates the PR; the introduced defect is the new guidance claiming that this launch mode works. Please narrow the paragraph to host-validator acceptance and recommend the applications own executable/apphost for functional completion, or fix and end-to-end test the managed-host invocation before documenting it as supported.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 93e76e8. The .NET 11 page no longer claims this launch mode works. It now says completion does not depend on where .NET is installed and points to Shell Completion. docs/shell-completion.md ("User commands") replaces the "must match the app binary" line. It says to run setup from the app's own executable, and describes a setup started as dotnet myapp.dll: it is accepted, but the PowerShell block registers for dotnet as well as myapp (BuildPowerShellCompletionCommandNames adds the process file name and path) and runs dotnet completion __complete without the DLL. The repair is myapp completion install --shell powershell --force from the executable, then a new shell (same app id, so the block is replaced). The adapter defect itself predates this PR and is not fixed here.

A completion setup started as `dotnet myapp.dll` does not give working
PowerShell completion: the generated completer is registered for dotnet as
well as the app and runs `dotnet completion __complete` without the DLL. The
.NET 11 page no longer says it works; docs/shell-completion.md now says to
set completion up from the app's own executable, what a setup through dotnet
does, and how to repair it.

The dotnetup section pins the dnx package version, since dnx without one
resolves the newest version when the server starts, and the MCP reference
does the same. It wraps the JSON entries in mcpServers, gives the Windows
value for each entry, the self-contained publish command, and the second
cause of the launch error: a tool built for an older major runtime, with
--allow-roll-forward for dnx and DOTNET_ROLL_FORWARD=Major for a global
tool, both checked in the SDK 11 container. The access modes are attributed
to the dotnetup documentation, and a host that sees another installation is
covered.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: add .NET 11 notes (dotnetup, dotnet watch, FORCE_COLOR)

2 participants