Skip to content

[Repo Assist] fix(scripts): derive TFM dynamically in validate-wsl-gateway.ps1 - #434

Merged
shanselman merged 2 commits into
masterfrom
repo-assist/fix-wsl-validation-tfm-path-432-f9032b53d1ba3a98
May 18, 2026
Merged

[Repo Assist] fix(scripts): derive TFM dynamically in validate-wsl-gateway.ps1#434
shanselman merged 2 commits into
masterfrom
repo-assist/fix-wsl-validation-tfm-path-432-f9032b53d1ba3a98

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Fixes validate-wsl-gateway.ps1 to dynamically derive the TargetFramework from OpenClaw.Tray.WinUI.csproj instead of hardcoding net10.0-windows10.0.19041.0.

Closes #432

Root Cause

The script had a hardcoded path:

src\OpenClaw.Tray.WinUI\bin\Debug\net10.0-windows10.0.19041.0\<rid>\OpenClaw.Tray.WinUI.exe

The project now targets net10.0-windows10.0.22621.0, so the executable was never found at the expected path. With -NoBuild, this caused an immediate "executable not found" error; without it, a fresh build would produce output at the new TFM path and the script would still fail to locate it.

Fix

Read TargetFramework from the csproj at startup using PowerShell XML parsing:

$trayTfm = ([xml](Get-Content $trayProject)).Project.PropertyGroup |
    ForEach-Object { $_.TargetFramework } |
    Where-Object { $_ } |
    Select-Object -First 1
if (-not $trayTfm) { throw "Could not derive TargetFramework from $trayProject" }
$trayExe = Join-Path $repoRoot "src\OpenClaw.Tray.WinUI\bin\Debug\$trayTfm\$runtimeIdentifier\OpenClaw.Tray.WinUI.exe"

This also ensures the error message for a missing executable shows the actual path being probed.

Test Status

Script is a PowerShell-only validation helper; no C# test suite covers it directly. The fix was manually verified by confirming the csproj XML parse produces net10.0-windows10.0.22621.0 from the current project file. Build and unit tests are unaffected:

dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj
dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj

(Infrastructure-only — runs on Linux, no Windows build change.)

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a

Closes #432

The script hardcoded net10.0-windows10.0.19041.0 but the tray project now
targets net10.0-windows10.0.22621.0. Parse TargetFramework from the csproj
at runtime so the path stays correct when the TFM changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use a literal raw read when parsing the tray project file so path handling and XML parsing stay predictable.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@shanselman
shanselman merged commit b6261b1 into master May 18, 2026
21 of 22 checks passed
@shanselman
shanselman deleted the repo-assist/fix-wsl-validation-tfm-path-432-f9032b53d1ba3a98 branch May 18, 2026 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix WSL gateway validation tray output path discovery

1 participant