diff --git a/src/Cli/Microsoft.Maui.Cli/DevFlow/Broker/BrokerClient.cs b/src/Cli/Microsoft.Maui.Cli/DevFlow/Broker/BrokerClient.cs index ec0563696..3f57224c4 100644 --- a/src/Cli/Microsoft.Maui.Cli/DevFlow/Broker/BrokerClient.cs +++ b/src/Cli/Microsoft.Maui.Cli/DevFlow/Broker/BrokerClient.cs @@ -232,7 +232,9 @@ private static void CleanupStaleBroker() string arguments; // If running via `dotnet run` or `dotnet `, exePath is the dotnet host. - // In that case, use `dotnet broker start --foreground` instead. + // In that case, use `dotnet devflow broker start --foreground` instead. + // Note: the `devflow` token is required because broker is a subcommand of devflow, + // not a top-level CLI command. if (exePath.EndsWith("dotnet", StringComparison.OrdinalIgnoreCase) || exePath.EndsWith("dotnet.exe", StringComparison.OrdinalIgnoreCase)) { @@ -243,12 +245,12 @@ private static void CleanupStaleBroker() return null; } fileName = exePath; - arguments = $"\"{dllPath}\" broker start --foreground"; + arguments = $"\"{dllPath}\" devflow broker start --foreground"; } else { fileName = exePath; - arguments = "broker start --foreground"; + arguments = "devflow broker start --foreground"; } var startInfo = new ProcessStartInfo