Files
vs-code-dotnet-solution-lau…/package.json
T
maxandClaude Fable 5.1 0300dfa42f Per-project launch options, publish/test tasks, explorer badge, keybindings
- dotnetSolution.launch.projects: args, env, cwd, console and profile
  per project name, layered over the global settings and
  Properties/launchSettings.json. Applied to the debug button and,
  through resolveDebugConfiguration, to the launch.json entry too.
- publish and test task targets with the same configuration/platform.
- Problems panel opens when a task fails.
- The startup csproj and its folder are marked in the explorer.
- F5 / Ctrl+F5 / Ctrl+Shift+B map to debug/run/build until a launch.json
  entry exists; Ctrl+Alt+C and Ctrl+Alt+P open the pickers.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169iPWwKHZoBTNN9qwXiwqk
2026-09-08 13:33:12 +02:00

353 lines
12 KiB
JSON

{
"name": "dotnet-solution-launcher",
"displayName": ".NET Solution Launcher",
"description": "Startup project and solution configuration (Debug|x64, Test|x64, ...) in the status bar, with build and debug that honour them. Made for DotRush, which shows the configuration but not the project and never passes the platform.",
"version": "0.1.0",
"publisher": "local",
"license": "MIT",
"engines": {
"vscode": "^1.85.0"
},
"categories": [
"Debuggers",
"Other"
],
"keywords": [
"dotnet",
"csharp",
"solution",
"configuration",
"dotrush",
"startup project"
],
"activationEvents": [
"onLanguage:csharp",
"onDebug",
"workspaceContains:**/*.{sln,slnx,csproj}"
],
"main": "./out/extension.js",
"contributes": {
"commands": [
{
"command": "dotnetSolution.selectStartupProject",
"title": "Select Startup Project",
"category": ".NET Solution"
},
{
"command": "dotnetSolution.selectConfiguration",
"title": "Select Configuration",
"category": ".NET Solution"
},
{
"command": "dotnetSolution.selectSolution",
"title": "Select Solution",
"category": ".NET Solution"
},
{
"command": "dotnetSolution.build",
"title": "Build",
"category": ".NET Solution",
"icon": "$(tools)"
},
{
"command": "dotnetSolution.rebuild",
"title": "Rebuild",
"category": ".NET Solution"
},
{
"command": "dotnetSolution.clean",
"title": "Clean",
"category": ".NET Solution"
},
{
"command": "dotnetSolution.publish",
"title": "Publish Startup Project",
"category": ".NET Solution",
"icon": "$(package)"
},
{
"command": "dotnetSolution.test",
"title": "Run Tests",
"category": ".NET Solution",
"icon": "$(beaker)"
},
{
"command": "dotnetSolution.debug",
"title": "Debug Startup Project",
"category": ".NET Solution",
"icon": "$(debug-alt)"
},
{
"command": "dotnetSolution.run",
"title": "Run Startup Project (without debugging)",
"category": ".NET Solution",
"icon": "$(play)"
},
{
"command": "dotnetSolution.generateLaunchConfig",
"title": "Create launch.json and tasks.json entries",
"category": ".NET Solution"
},
{
"command": "dotnetSolution.reload",
"title": "Reload Solution",
"category": ".NET Solution"
},
{
"command": "dotnetSolution.showOutput",
"title": "Show Log",
"category": ".NET Solution"
},
{
"command": "dotnetSolution.setStartupProject",
"title": "Set as Startup Project (.NET Solution)",
"category": ".NET Solution"
}
],
"menus": {
"explorer/context": [
{
"command": "dotnetSolution.setStartupProject",
"when": "resourceExtname =~ /\\.(cs|fs|vb)proj$/",
"group": "dotnet_0@0"
}
],
"commandPalette": [
{
"command": "dotnetSolution.setStartupProject",
"when": "false"
}
]
},
"taskDefinitions": [
{
"type": "dotnet-solution",
"required": [],
"properties": {
"target": {
"type": "string",
"enum": [
"build",
"rebuild",
"clean",
"publish",
"test"
],
"default": "build",
"description": "What to do. Publish always targets the startup project; test runs the solution or project depending on scope."
},
"scope": {
"type": "string",
"enum": [
"solution",
"project"
],
"description": "Build the whole solution with the selected solution configuration, or only the startup project with the project configuration the solution maps it to. Defaults to the dotnetSolution.buildScope setting."
},
"args": {
"type": "array",
"items": {
"type": "string"
},
"description": "Extra arguments appended to the dotnet command."
}
}
}
],
"problemMatchers": [],
"configuration": {
"title": ".NET Solution Launcher",
"properties": {
"dotnetSolution.solution": {
"type": "string",
"default": "",
"description": "Solution file to use, relative to the workspace. Empty picks the one closest to the workspace root, preferring the one with the most projects."
},
"dotnetSolution.buildScope": {
"type": "string",
"enum": [
"solution",
"project"
],
"enumDescriptions": [
"dotnet build <solution> -c <Configuration> -p:Platform=<Platform>. Honours solution-level project dependencies and per-project configuration mapping, like Visual Studio's Build Solution.",
"dotnet build <startup project> with the configuration and platform the solution maps it to. Faster, but ignores dependencies that only exist in the .sln (ProjectDependencies)."
],
"default": "solution",
"description": "What the build task builds before a launch."
},
"dotnetSolution.targetFramework": {
"type": "string",
"default": "",
"description": "Target framework to launch for multi-targeting projects (TargetFrameworks). Empty uses the first one."
},
"dotnetSolution.launch.args": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "Arguments passed to the startup project when launched from this extension."
},
"dotnetSolution.launch.env": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"default": {},
"description": "Environment variables for the launched startup project."
},
"dotnetSolution.launch.cwd": {
"type": "string",
"default": "",
"description": "Working directory for the launched startup project, relative to the project folder. Empty uses launchSettings.json or the output directory (TargetDir)."
},
"dotnetSolution.launch.console": {
"type": "string",
"enum": [
"internalConsole",
"integratedTerminal",
"externalTerminal"
],
"default": "internalConsole",
"description": "Console for the debugged application."
},
"dotnetSolution.debugType": {
"type": "string",
"default": "coreclr",
"description": "Debug adapter type. DotRush and C# Dev Kit both provide coreclr."
},
"dotnetSolution.syncDotRush": {
"type": "boolean",
"default": true,
"markdownDescription": "Keep DotRush's own startup project in sync (`dotrush.setStartupProject`), so its test explorer, launchSettings lookup and `${command:dotrush.activeProjectPath}` agree with the status bar here."
},
"dotnetSolution.syncDotRushWorkspaceProperties": {
"type": "boolean",
"default": false,
"markdownDescription": "Write `Configuration=<Cfg>;Platform=<Platform>` into `dotrush.roslyn.workspaceProperties` when the configuration changes, so IntelliSense sees the same DefineConstants as the build. DotRush reloads its workspace on each change, which is why this is off by default."
},
"dotnetSolution.additionalBuildArguments": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "Extra arguments for every dotnet build / clean run by this extension."
},
"dotnetSolution.launch.projects": {
"type": "object",
"default": {},
"markdownDescription": "Per-project launch options, keyed by project name. Each entry may set `args`, `env`, `cwd` (relative to the project folder), `console` and `profile` (a launchSettings.json profile name). These override the global `dotnetSolution.launch.*` settings and `Properties/launchSettings.json`.\n\nExample: `{ \"Nerfed.Builder\": { \"args\": [\"-build\"], \"cwd\": \"../Bin/Nerfed.Builder\" } }`",
"additionalProperties": {
"type": "object",
"properties": {
"args": {
"type": "array",
"items": {
"type": "string"
}
},
"env": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"cwd": {
"type": "string"
},
"console": {
"type": "string",
"enum": [
"internalConsole",
"integratedTerminal",
"externalTerminal"
]
},
"profile": {
"type": "string"
}
}
}
},
"dotnetSolution.launch.profile": {
"type": "string",
"default": "",
"description": "Profile to take from Properties/launchSettings.json. Empty picks the first profile with commandName \"Project\"."
},
"dotnetSolution.publish.runtime": {
"type": "string",
"default": "",
"description": "Runtime identifier for dotnet publish, e.g. win-x64. Required for PublishAot. Empty omits -r."
},
"dotnetSolution.publish.args": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "Extra arguments for dotnet publish, e.g. [\"--self-contained\"]."
},
"dotnetSolution.test.args": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "Extra arguments for dotnet test, e.g. [\"--no-build\"] or a filter."
},
"dotnetSolution.showProblemsOnFailure": {
"type": "boolean",
"default": true,
"description": "Open the Problems panel when a build, publish or test run fails."
}
}
},
"keybindings": [
{
"command": "dotnetSolution.build",
"key": "ctrl+shift+b",
"mac": "cmd+shift+b",
"when": "dotnetSolution.active && !dotnetSolution.hasLaunchEntry"
},
{
"command": "dotnetSolution.debug",
"key": "f5",
"when": "dotnetSolution.active && !inDebugMode && !dotnetSolution.hasLaunchEntry && !terminalFocus"
},
{
"command": "dotnetSolution.run",
"key": "ctrl+f5",
"when": "dotnetSolution.active && !inDebugMode && !dotnetSolution.hasLaunchEntry"
},
{
"command": "dotnetSolution.selectConfiguration",
"key": "ctrl+alt+c",
"when": "dotnetSolution.active"
},
{
"command": "dotnetSolution.selectStartupProject",
"key": "ctrl+alt+p",
"when": "dotnetSolution.active"
}
]
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"pretest": "npm run compile",
"test": "node ./out/test/runTest.js",
"test:unit": "npm run compile && mocha --ui tdd out/test/unit/*.test.js"
},
"devDependencies": {
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.0",
"@types/vscode": "^1.85.0",
"@vscode/test-electron": "^2.4.1",
"mocha": "^10.4.0",
"typescript": "^5.4.0"
}
}