Skip to content

Commit 8aae538

Browse files
authored
fix: find bundled test_app_exe from exe directory, not BaseDirectory (#71)
AppDomain.CurrentDomain.BaseDirectory points to the extraction temp dir when running as a single-file publish. Use Environment.ProcessPath to locate the actual exe directory where test_app_exe/ lives.
1 parent 66f3a27 commit 8aae538

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Services/SimulationService.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ public async Task<SimulationResult> RunAsync(
4747
else
4848
{
4949
// Strategy 1: bundled exes (release package)
50-
var bundledDir = Path.Combine(toolsDir, "test_app_exe");
50+
// Use ProcessPath not BaseDirectory — single-file publish extracts to a temp dir
51+
var appRoot = Path.GetDirectoryName(Environment.ProcessPath)!;
52+
var bundledDir = Path.Combine(appRoot, "test_app_exe");
5153
if (Directory.Exists(bundledDir) &&
5254
File.Exists(Path.Combine(bundledDir, "ClientSample.exe")) &&
5355
File.Exists(Path.Combine(bundledDir, "UpgradeSample.exe")))

0 commit comments

Comments
 (0)