[Repo Assist] fix(scripts): derive TFM dynamically in validate-wsl-gateway.ps1 - #434
Merged
shanselman merged 2 commits intoMay 18, 2026
Conversation
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
deleted the
repo-assist/fix-wsl-validation-tfm-path-432-f9032b53d1ba3a98
branch
May 18, 2026 02:43
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.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Fixes
validate-wsl-gateway.ps1to dynamically derive theTargetFrameworkfromOpenClaw.Tray.WinUI.csprojinstead of hardcodingnet10.0-windows10.0.19041.0.Closes #432
Root Cause
The script had a hardcoded path:
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
TargetFrameworkfrom the csproj at startup using PowerShell XML parsing: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.0from the current project file. Build and unit tests are unaffected:(Infrastructure-only — runs on Linux, no Windows build change.)