godot-csharp-vscode
godot-csharp-vscode copied to clipboard
Plugin does not rebuild project upon launching game via debug configuration
OS/device including version: macOS 10.15.5 Godot version: v3.2.2.stable.mono.official VSCode version: 1.47.2
Reproduction details:
- Create a Godot C# launch.json via VSCode's debug view.
- Configure the Launch configuration with the correct path to the Godot executable
- Run the game via the Launch configuration, then close the game.
- Add a
Console.WriteLineline to a method on any attached script in the main scene. - Run the game via the Launch configuration again.
Expected: Any changes made to a script will be included when you launch the game via VSCode's debugger.
Actual: The project is not rebuilt when launching the game and the contents of the Console.WriteLine will not be printed to the debug output.
Notes:
The same behaviour is noticed when running the Godot via the command line. Running Godot --path <PATH_TO_PROJECT> directly does not pick up any changes to a C# script. If I run msbuild <PROJECT>.sln first however, the script changes will then be picked up by the Godot command.
If anyone looking for workaround: you can create a build task and add use it as prelaunch task.
My configurations for MS Windwos looks like:
tasks.json
{ "version": "2.0.0", "tasks": [ { "label": "mybuild", "command": "dotnet.EXE", "args": [ "msbuild", "${workspaceRoot}/C Sharp.sln", "/t:Build" ], "type": "shell", "problemMatcher": [], "group": { "kind": "build", "isDefault": true } } ] }
launch.json
{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Play in Editor", ... }, { "name": "Launch", "type": "godot-mono", "request": "launch", "mode": "executable", "executable": "${workspaceRoot}/Godot.exe", "executableArguments": [ "--path", "${workspaceRoot}" ], "preLaunchTask": "mybuild" }, { "name": "Attach", ... } ] }