-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I setup the C# debugger with Godot? Cannot stop on breakpoints #12
Comments
I've figured out how to setup debugging on C# godot now. I'll leave this comment here for posterity, in case someone else, especially newcomers, get stuck with setting up C# Godot debugging. To anyone struggling with getting this setup, don't worry - follow these steps and good luck! Note this answer applies to both the tar version of .NET Godot and this flatpak. But if you're new to .NET Godot, this comment also has general useful info to know-how, even if your not using this specific flatpak godot. But quickly for newbies to flatpak, a flatpak is a containerized application, which contains its own packages with their own versions, so it can reliably run. Flatpaks run in the 'flatpak sandbox', or basically with restricted permissions/access to the rest of your files. Luckily, all that means for setting up C# debugging with this Godot flatpak, is explained here in the README for this flatpak: https://github.com/flathub/org.godotengine.GodotSharp#using-an-external-script-editor Firstly, I learnt that Godot's in-built editor does not support C# debugging, and it was never intended to: godotengine/godot#37691 (comment) So the C# Godot Editor will always skip breakpoints and/or has little autocompletion/IDE support. It was always intended to that you'll use editors that already have great C# support, so pick your favourite C# editor. I'll use VSCode with extensions here for the rest of this answer, but any IDE that supports C# can be used. 1) Ensure that the latest dotnet is installed properly and working.Here's the version I used, but the latest should do, even from the Ubuntu repositories. Completely uninstall and reinstall dotnet and sort out your repos for Linux (Ubuntu) users if you have to:
2) Install and ensure that your C# Dev Kit Extension is working properly.To check its working, try running the Here's the repo for other issues related to this extension The C# dev kit alone should be enough to give you intellisense even for Godot projects. Now open Godot, and configure it to use VSCode. This step is pretty easy, but in case you're struggling:
3) I recommend installing the: Godot .NET Tools VSCode Extension.Then run the command {
"version": "0.2.0",
"configurations": [
{
"name": "Launch", // <-- This is the configuration that worked for me
"type": "coreclr",
"request": "launch",
"program": "${config:godot-dotnet-tools.executablePath}",
"preLaunchTask": "build",
"args": [
"--path",
"${workspaceRoot}"
],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Launch Editor",
"type": "coreclr",
"request": "launch",
"program": "${config:godot-dotnet-tools.executablePath}",
"preLaunchTask": "build",
"args": [
"--path",
"${workspaceRoot}",
"--editor"
],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Attach to Process",
"type": "coreclr",
"request": "attach"
}
]
} This extension C# Tools for Godot did NOT work for me, and you don't need it either. I wouldn't bother installing it. If you want to see another working vscode launch.json that works, see: https://github.com/chickensoft-games/GodotGame/blob/main/.vscode/launch.json Note: Using the vscode launch settings 4) Put the Exact Full Godot Executable Path into vscode's
|
Hello everyone! This may be a noob question as I'm new to Godot and flatpak (and I use Ubuntu). I'm having some difficulty setting up the C# debugger with godot; I can't configure it to stop on breakpoints.
If I set breakpoints in the Godot Script Editor, my debugger will not stop on them.
I've also tried using VSCode as my script editor (I would prefer using that if I can), I setup vscode in the godot settings as described in the Readme, with
flatpak-spawn --host
. I've tried using a variety of launch configurations, but none of them would stop on the breakpoints. VSCode tells me that 'no debug symbols could be found' when I hover over the breakpoint, but when I check the directory where I built my game, I can see the 'game.pdb' is in the same directory as my 'game.dll'.I have managed to setup C# debugging before by manually installing Godot from the website, but I want to use this flatpak for the automatic updating. I also want to make sure that this issue isn't related to flatpak sandboxing. I had a brief read of the other open issue: #2 but I cannot tell if this is related or not.
I've also tried reinstalling my dotnet installation, but still no luck. I think the root of the problem is that Godot just isn't stopping on breakpoints.
So I'm not too sure what's going on here. Has anyone got a C# debugging setup with this flatpak?
The text was updated successfully, but these errors were encountered: