| 1 | # `aid-publish` |
| 2 | |
| 3 | `aid-publish` is a .NET tool that wraps `dotnet publish` with two pragmatic features: |
| 4 | |
| 5 | - Mirrors the publish output into a **fixed target directory** (no-spaces friendly) so you can reliably point MCP configs or shortcuts to a stable path. |
| 6 | - Optionally **kills the running app** *only if* it is running from that target path (prevents file-lock publish failures). |
| 7 | |
| 8 | ## Install (local tool) |
| 9 | |
| 10 | From a repo root: |
| 11 | |
| 12 | ```bash |
| 13 | dotnet tool install AIGuiders.DotnetTools.PublishFixedTarget |
| 14 | ``` |
| 15 | |
| 16 | ## Usage |
| 17 | |
| 18 | ```bash |
| 19 | dotnet aid-publish -Project path/to/app.csproj -Target D:\my-app-debug -Runtime win-x64 -Configuration Debug -SelfContained -KillRunning |
| 20 | ``` |
| 21 | |
| 22 | Show help: |
| 23 | |
| 24 | ```bash |
| 25 | dotnet aid-publish -Help |
| 26 | ``` |
| 27 | |
| 28 | ## Options (high level) |
| 29 | |
| 30 | - `-Project`: `.csproj` to publish (required) |
| 31 | - `-Target`: target directory to mirror into (required) |
| 32 | - `-Runtime`: RID (default `win-x64`) |
| 33 | - `-Configuration`: `Debug` or `Release` (default `Debug`) |
| 34 | - `-SelfContained`: publish self-contained |
| 35 | - `-OutDir`: publish output directory (default: `publish-{configuration}`) |
| 36 | - `-AppExeName`: executable/process name if it differs from project file name |
| 37 | - `-KillRunning`: kill the app if it is running from the target path |
| 38 | - `-MsbuildProp`: repeatable `/p:Name=Value` |
| 39 | - `-DotnetArg`: repeatable extra args appended to `dotnet publish` |
| 40 | - `-RequireMirrorFile`: repeatable relative path — after mirroring **must exist as file** under `Target`. Example for **RoslynMcp** (`Microsoft.CodeAnalysis.Workspaces.MSBuild`): `BuildHost-netcore/Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.dll` — catches incomplete publish output before MCP fails at runtime. |
| 41 | |
| 42 | |
View only · write via MCP/CIDE