0037: Run profile kinds
Status
Accepted (owner, 2026-10-14, after a research on launch profiles and engines and its adversarial audit; lands in the P3 run-profiles batch). It takes the first free number after 0036. Where the owner delegated a choice the choice is recorded as a coordinator default.
Context
- Run is enabled only for
OutputType=Exe(Project.CanCompileAndRun,RunCommandHandler), so it is disabled today for Godot and UnrealSharp projects, which are libraries, whatever their launch profile says. Properties/launchSettings.jsonis shared withdotnet run, Visual Studio and Rider.Executableis its standard kind for "build this project, then start another program". Godot's C# docs and the profiles UnrealSharp generates use it.dotnet runruns anExecutableprofile only from SDK 10.0.200; 10.0.1xx skips it.GetRunCommandpasses no--no-launch-profile, so what F5 does depends on the user's SDK band. The CLI has noOutputTypegate and already starts UnrealEditor from a library.- An unsupported kind selected by name makes
dotnet runprint an error and then run the project without the profile. - Relative paths differ between consumers:
dotnet runresolves a relativeworkingDirectoryfrom the folder holdinglaunchSettings.json(Properties/), Visual Studio from the project folder. - The research proposed a public
IRunProfileKindextension point and a trust prompt. The audit found both premature or misfit: the cases cited for the point (U3's open editor, Unity) start no process, and the trust model has no place for a per-command prompt.
Decision
ProjectandExecutableare supported natively. NetPrints readsProperties/launchSettings.jsonand applies the profile itself, with an explicit argv and working directory on the process request, so the result does not depend on the SDK band. The editor and the CLI behave the same.Projectrunsdotnet run --no-build --no-launch-profile -- <args>;ExecutablestartsexecutablePathafter the build, on any output type.- Unknown kinds are disabled, not delegated.
IISExpress,Docker,WSL2and the rest are listed with the reason, skipped when choosing the default profile, and never handed todotnet run. In the CLI a selected unknown kind exits 2. - Run is gated by the selected profile's kind, not by
OutputType=Exe. TheProjectkind needs an executable output;Executabledoes not. - Kinds are an internal table in P3. A public experimental
AddRunProfileKind, under a new NPXE id, is added only when U3 or NetPrintsUnity needs it, and is shaped then: build or no build, an outcome handled without a process, and a process lifetime hint. - No new trust prompt. Building already trusts the project. The first run of an
Executableprofile prints the resolved command line in Output, and the Run section shows an argv preview. - Paths follow Visual Studio, except the default working directory, which follows
dotnet run. A relativeworkingDirectoryis resolved from the project folder, as Visual Studio does. An absent one is the project folder, asdotnet rundoes; Visual Studio would use the output folder. This is a deliberate hybrid: users comparenetprints runwithdotnet run, so the case with no setting must behave the same as the command they already know. AnexecutablePathwith a separator is relative to the working directory, and a bare name is looked up onPATH. The Run section andnetprints run --helpwarn thatdotnet runresolves a relativeworkingDirectoryfromProperties/. - Variables.
%NAME%is expanded from the environment and$(Name)from captured project properties, then the string is split. An unset%NAME%inexecutablePathorworkingDirectory, an uncaptured property or a missing executable blocks the run before anything starts; in arguments and env it is a warning and the text stays literal. - Environment. The profile's environment and
DOTNET_LAUNCH_PROFILEreach the program only:dotnet run -e NAME=VALUEforProject(SDK 9.0.200 or later), the process request forExecutable. Passing them on thedotnet runprocess would turn them into MSBuild properties. - Stop and unload. Stop asks the program to close (the main window, or SIGTERM) and kills the process tree after a
timeout. Unloading a project whose
Executablerun is still alive asks "leave it running?". - Executable resolution. NetPrints passes the OS an absolute path: on Windows
PATHis searched with.exeand.com; a macOS.appfolder resolves toContents/MacOS/<binary>or is reported. A.cmdor.battarget is rejected or warned about, because it runs throughcmd.exe. Arguments are split with the WindowsCommandLineToArgvWrules on every OS and passed throughArgumentList; no shell is involved. - Desktop launchers may not inherit shell variables. The message says the variable is not set; a per-user run environment setting is a later follow-up.
- Godot needs no core code. Its profile is an
Executableone that starts%GODOT4%; the sample extension ships it as template data and registers no kind. U3 reuses theExecutableprofiles UnrealSharp generates.
Alternatives rejected
- A public
IRunProfileKindin P3 (the research). Nothing in P3 needs it; the cases that would are not "build, then start a process", and a shape fixed now is likely wrong. ADR-0013's precedent applies: data that cannot express a rule is pressure for a profile feature, not for a plug-in. - A trust prompt keyed to
TrustedProjects. The list means "project extensions may load", so trusting a command would load extensions on the next open, and a changedexecutablePathafter a pull would not prompt again. - Delegating unknown kinds to
dotnet run. It runs the project without the profile. - A tool locator or a project-kind detector in the core.
%NAME%plusPATHcovers the first; project templates (ADR-0020) cover the second. dotnet runrelative-path rules. Godot's own instructions (working directory.) assume Visual Studio's.
Consequences
- About 7 days for the run-profiles batch, 2 of them for
Executable, the kind table and the Run gate. - Run profiles need the P3a command bar and the Run section; the CLI gets
-lp|--launch-profileand--no-launch-profile. - Cases to cover with tests: argument join and split round-trip, expansion before splitting, case-sensitive
commandNameand profile names that differ only by case,.appresolution, and the WindowsPATHlookup. - Known limits, documented rather than fixed:
- the
MSBUILD_EXE_PATH,MSBuildSDKsPathandMSBuildExtensionsPathvalues MSBuildLocator sets in NetPrints' process reach engines that run their owndotnet build, and a process request cannot unset a variable; - the Godot editor loads
.godot/mono/temp/bin/Debug, so with a Release build selected it runs a stale assembly; - upstream UnrealSharp writes empty
executablePathvalues on Linux (the fork'sfeature/linux-supportfills them), and itsDebugprofile starts DebugGame with no debugger; - a GUI-subsystem program such as
UnrealEditor.exehas no stdout to capture.
- the
- Writing
launchSettings.jsonback must keep unknown keys, kinds and their order, and warn about comments. - Open: the
AddRunProfileKindshape, decided with U3 or NetPrintsUnity.