Skip to content

[Bug] "Not found .NET6 Runtime" on activation although .NET 6 is installed — the .NET Runtime installer's "Modify Setup" page keeps popping up #582

Open

Description

@yxlyydsHUB

Environment

  • Windows 11 Home, 10.0.26200 (x64)

  • VS Code 1.141.0

  • EIDE 3.27.2 (cl.eide)

  • .NET Runtime 6.0.5 (x64) is installed and working:

    C:> dotnet --list-runtimes
    Microsoft.NETCore.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.WindowsDesktop.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Symptom

Every time a VS Code window with a project containing .eide is opened, the
"Microsoft .NET Runtime - 6.0.5 (x64) Setup / Modify Setup / Repair · Uninstall · Close"
window appears. After closing it, EIDE writes to ~/.eide/cl.eide.log:

安装 [.NET6 runtime] 时失败,你需要手动安装它!
(Failed to install [.NET6 runtime], you need to install it manually!)

Key lines from the EIDE output channel (Embedded IDE):

[Info] Embedded IDE launch begin
[Info] Checking .NET runtime ...
[Info] Exec cmd: 'dotnet --list-runtimes'
[Error] Command failed: dotnet --list-runtimes
'dotnet' 不是内部或外部命令,也不是可运行的程序或批处理文件。
('dotnet' is not recognized as an internal or external command,
operable program or batch file.)
at Object.execSync (node:child_process:1047:15)
at Object.execSync (node:electron/js2c/node_init:2:17568)
at c:\Users<user>.vscode\extensions\cl.eide-3.27.2\dist\extension.js:8:2004508
[Info] Not found .NET6 Runtime !

EIDE then picks up %TEMP%\dotnet-runtime-6.0.5-win-x64.exe and runs it via execFileSync
with no arguments. Because the product is already installed, Burn shows the "Modify Setup"
page, which the user closes (exit code 1602) — EIDE then reports the install as failed.

Key point: not deterministic in the same environment — looks like a timing/race issue

On the same machine, in the same VS Code main process (same extension host process),
the very same command gave opposite results:

21:06:57 activation -> Exec cmd: 'dotnet --list-runtimes' -> Command failed (as above)
21:33:53 another window, new activation ->
Exec cmd: 'dotnet --list-runtimes' ->
Microsoft.NETCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
[Info] .NET runtime: 'Microsoft.NETCore.App 6.0.5 [...]' found !

Out of 19 activations today, the vast majority failed (16:31–20:25 in a row),
with only a few succeeding (e.g. 20:49, 21:33).

Investigation notes (for reference)

  1. Nothing is wrong on the OS side: the machine PATH in the registry contains
    C:\Program Files\dotnet\; dotnet --list-runtimes works in a normal command prompt;
    the 6.0.5 folder is complete (224 files / 69 MB); your unify_builder.exe --help works
    (prints "unify_builder 3.11.1").

  2. I read the raw environment block of the extension host process that failed. Its Path is:

    [11 EIDE tool directories] + [system PATH (entry 建议增加macos的支持 #18 is C:\Program Files\dotnet)]

    • [dotnet / x86 dotnet appended by EIDE]

    Feeding that exact environment block into a fresh cmd process makes
    dotnet --list-runtimes succeed — so the environment content itself is fine.

  3. The throwing offset extension.js:8:2004508 is the second execSync of the check
    (const t = a.execSync("dotnet --list-runtimes")), i.e. the one right after
    catch { appendToSysEnv(process.env, ["C:\Program Files\dotnet", "C:\Program Files (x86)\dotnet"]) }.
    Since it still reports "not recognized" after those directories were appended,
    the child cmd could not have had any system PATH at all at that moment.

  4. Hypothesis: the toolchain environment initialization in the extension host
    (prependToSysEnv / concatSystemEnvPath / writing tool directories into process.env)
    runs in a different order relative to the .NET check. When the check runs first,
    cmd's PATH contains only EIDE's own tool directories, dotnet cannot be resolved,
    and EIDE wrongly concludes that .NET 6 is not installed.

Suggestions

  • Do not rely on the current process.env PATH for the check. Build it explicitly, e.g.
    execSync("dotnet --list-runtimes", { env: concatSystemEnvPath([], ) })
    or merge the system PATH into process.env before running the check.
  • After a failed check, do not launch the UI installer unconditionally. Please check whether
    the product is already installed first (or run it with /quiet /norestart). Otherwise users
    who already have .NET 6 get the "Modify Setup" dialog over and over.
  • (Side note: the failed check does not break unify_builder builds — it is just noise —
    but the popup UX is quite bad.)

Reproduction

Open any VS Code window with a project containing .eide; on this machine roughly
6–7 out of 8 launches trigger it.

Attachments

  • EIDE output channel log (1-eide-log.log)
  • The Burn logs left by the popup in %TEMP% (Microsoft_.NET_Runtime_-6.0.5(x64)_*.log,
    the ~4 KB ones — they show the Modify page exiting with 1602)

burn-log-2106.log
eide-log-FAIL-2106.log
eide-log-OK-2133.log
eide-user-log.log
README.txt

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions