Skip to content

Fix relaunch.ps1 build output path#358

Merged
PureWeen merged 3 commits intomainfrom
debug/relaunch-fix
Mar 11, 2026
Merged

Fix relaunch.ps1 build output path#358
PureWeen merged 3 commits intomainfrom
debug/relaunch-fix

Conversation

@PureWeen
Copy link
Owner

The relaunch.ps1 script was failing with 'file not found' when attempting to launch the built executable. The issue was in the $BuildDir path construction on line 13, which was missing the win-x64 runtime identifier (RID) subdirectory.

The Problem:
When building a Windows Forms .NET 10 application with RID-specific output, the build artifacts are placed in a subdirectory matching the RID (e.g., win-x64). The original path was:
\
bin\Debug\net10.0-windows10.0.19041.0
\\

But the actual executable location is:
\
bin\Debug\net10.0-windows10.0.19041.0\win-x64
\\

The Fix:
Updated the path to include the win-x64 RID subdirectory so Start-Process can correctly locate and launch the built exe.

PureWeen and others added 3 commits March 11, 2026 17:16
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Detect runtime identifier from build output directory instead of hardcoding win-x64
- Extract Configuration and Framework into variables for consistency
- Pass -c Debug explicitly to dotnet build

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…stency

- Filter RID subdirectory by presence of exe instead of Select-Object -First 1
- Add param() block so Configuration can be overridden (defaults to Debug)
- Use Join-Path instead of backslash string interpolation for paths

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen PureWeen merged commit 30e3651 into main Mar 11, 2026
@PureWeen PureWeen deleted the debug/relaunch-fix branch March 11, 2026 23:37
Copy link
Owner Author

@PureWeen PureWeen left a comment

Choose a reason for hiding this comment

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

PR #358 Round 2 -- Approve

Finding 1 (arbitrary RID selection): FIXED -- now filters by exe presence.
Finding 2 (non-RID fallback): Still present but LOW risk for .NET 10 Desktop.

Verdict: Approve -- code is materially better.

4-model AI consensus (Round 2)

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.

1 participant