Hello everyone, In this post, we’ll walk through setting up the Godot Engine with Visual Studio so we can launch and debug our game directly from within Visual Studio. For this we need the latest versions of both Visual Studio and the Godot game engine (.NET runtime). Once you’ve downloaded and installed both of them, we can proceed to set up Godot Engine with Visual Studio.
First, open Godot Engine and create a new project. Then, navigate to Editor -> Editor Settings. Find Dotnet -> Editor tab and select it. Make sure “External Editor” is set to Visual Studio and that the “Custom Exec Path” is pointing to your installed Visual Studio executable path.

Once you’ve completed the previous step, open your project in Visual Studio. Then, navigate to Debug -> [Your Project Name] Debug Properties and open it. Also, you can delete the default launch profile if it exists.

Next, select create a new profile option and choose the “Executable” option. You can also rename your profile to whatever you like.

First, make sure that the path to the executable to run is pointing to your Godot Engine executable file (Godot_v4.2-stable_mono_win64.exe).
For Command Line Arguments, you can pass any supported argument.
Use ‘.’ for the Working Directory to indicate that this is the current working directory.
Also, make sure to enable the “Native Code Debugging” option.

Once you have completed all these steps, you will be able to run and debug your game from within Visual Studio. If you encounter an error, you most likely have forgotten to set the startup Main Scene in Godot Engine.