{ "version": "2.0.0", "tasks": [ { "label": "build (Debug)", "command": "dotnet", "type": "process", "args": [ "build", "${workspaceFolder}/src/SwyxTray/SwyxTray.csproj", "-c", "Debug", // Das Paket Swyx.Client.ClmgrAPI waehlt die Interop-Assembly ueber // $(Platform) und bricht bei AnyCPU ab. Die csproj setzt x64 bereits // als Vorgabe; hier steht es noch einmal, damit die Aufgabe auch dann // uebersetzt, wenn jemand die Vorgabe aendert. "-p:Platform=x64", "-consoleloggerparameters:NoSummary" ], "problemMatcher": "$msCompile", "group": { "kind": "build", "isDefault": true } }, { "label": "build (Release)", "command": "dotnet", "type": "process", "args": [ "build", "${workspaceFolder}/src/SwyxTray/SwyxTray.csproj", "-c", "Release", "-p:Platform=x64", "-consoleloggerparameters:NoSummary" ], "problemMatcher": "$msCompile", "group": "build" }, { // Beendet eine laufende Instanz — egal in welcher Sitzung. Ohne das // schluege ein Start still fehl: die Einzelinstanz-Sperre laesst den // zweiten Prozess kommentarlos enden. "label": "SwyxTray beenden", "command": "powershell", "type": "process", "args": [ "-NoProfile", "-Command", // Wait-Process: erst zurueckkehren, wenn der Prozess wirklich weg ist — // sonst sieht der nachfolgende Start noch die Leiche in Get-Process. // Das abschliessende 'exit 0' ist Pflicht: findet Get-Process keinen // Prozess, steht $? auf false, und powershell -Command macht daraus // sonst Exit-Code 1 — die Kette briche ab, obwohl nichts zu tun war. "$p = Get-Process SwyxTray -ErrorAction SilentlyContinue; if ($p) { $p | Stop-Process -Force; $p | Wait-Process -Timeout 5 -ErrorAction SilentlyContinue }; exit 0" ], "problemMatcher": [] }, { // Startet die App in der DESKTOP-Sitzung des angemeldeten Benutzers — // noetig, wenn VS Code remote verbunden ist. Warum, steht im Skript. "label": "SwyxTray im Desktop starten (Debug)", "dependsOrder": "sequence", "dependsOn": ["SwyxTray beenden", "build (Debug)"], "command": "powershell", "type": "process", "args": [ "-NoProfile", "-ExecutionPolicy", "Bypass", "-File", "${workspaceFolder}/.vscode/start-desktop.ps1", "-Exe", "${workspaceFolder}/src/SwyxTray/bin/x64/Debug/net10.0-windows/win-x64/SwyxTray.exe" ], "problemMatcher": [] } ] }