Skip to content

Switch production server from dotnet run to published standalone exe#79

Merged
0101 merged 1 commit into
mainfrom
standalone-exe
Jun 15, 2026
Merged

Switch production server from dotnet run to published standalone exe#79
0101 merged 1 commit into
mainfrom
standalone-exe

Conversation

@0101

@0101 0101 commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Problem

Production start/restart launched the server with dotnet run -c Release --project src/Server. With dotnet run, Start-Process tracks the dotnet CLI host PID rather than the actual server process, which undermines the script's PID-file-based stop/status lifecycle logic in treemon.ps1.

Changes

  • treemon.ps1: Start-ProductionServer now runs dotnet publish -c Release -o .publish and launches the published Treemon.exe directly, yielding a clean server PID for the .treemon.pid file. A failed publish aborts the start.
  • src/Server/Server.fsproj: add <AssemblyName>Treemon</AssemblyName> so the published binary is Treemon.exe (the project file is Server.fsproj, which would otherwise emit Server.exe).
  • .gitignore: ignore the new .publish/ output directory.

Tests

  • dotnet publish -c Release -o .publish src/Server/Server.fsproj succeeds and produces .publish\Treemon.exe.

Replace 'dotnet run -c Release' with 'dotnet publish' + launch Treemon.exe
directly. The production process is now named Treemon.exe instead of
dotnet.exe, so dotnet build/test operations cannot accidentally kill it
via name-based process matching.

- Set AssemblyName to Treemon in Server.fsproj
- Add publish step to Start-ProductionServer (dotnet publish -c Release)
- Launch .publish/Treemon.exe instead of dotnet run
- Add .publish/ to .gitignore
@0101 0101 merged commit 064b011 into main Jun 15, 2026
1 check passed
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