xyz ok, let's look at the docs so I don't say this from memory:

https://docs.godotengine.org/en/stable/tutorials/scripting/c_sharp/c_sharp_basics.html

Godot bundles the parts of .NET needed to run already compiled games. However, Godot does not bundle the tools required to build and compile games, such as MSBuild and the C# compiler. These are included in the .NET SDK, and need to be installed separately.

In summary, you must have installed the .NET SDK and the .NET-enabled version of Godot.

you need the NET doodahs and a compiler, as well as an external editor and the NET version of godot.

C# support in Godot's built-in script editor is minimal. Consider using an external IDE or editor, such as Visual Studio Code or MonoDevelop. These provide autocompletion, debugging, and other useful features for C#. To select an external editor in Godot, click on Editor → Editor Settings and scroll down to Dotnet. Under Dotnet, click on Editor, and select your external editor of choice. Godot currently supports the following external editors:

Visual Studio 2022

Visual Studio Code

MonoDevelop

Visual Studio for Mac

JetBrains Rider

external editor because godot supports gdscript only. Then it lists the steps to configure godot for each external editor.

Visual Studio Code¶

After reading the "Prerequisites" section, you can download and install Visual Studio Code (aka VS Code).

In Godot's Editor → Editor Settings menu:

Set Dotnet -> Editor -> External Editor to Visual Studio Code.

In Visual Studio Code:

Install the C# extension.

Note

If you are using Linux you need to install the Mono SDK for the C# tools plugin to work.

To configure a project for debugging, you need a tasks.json and launch.json file in the .vscode folder with the necessary configuration. An example configuration can be found here . In the launch.json file, make sure the program parameter in the relevant configuration points to your Godot executable, either by changing it to the path of the executable or by defining a GODOT4 environment variable that points to the executable. Now, when you start the debugger in Visual Studio Code, your Godot project will run.
Visual Studio (Windows only)¶

Download and install the latest version of Visual Studio. Visual Studio will include the required SDKs if you have the correct workloads selected, so you don't need to manually install the things listed in the "Prerequisites" section.

While installing Visual Studio, select this workload:

.NET desktop development

In Godot's Editor → Editor Settings menu:

Set Dotnet -> Editor -> External Editor to Visual Studio.

Note

If you see an error like "Unable to find package Godot.NET.Sdk", your NuGet configuration may be incorrect and need to be fixed.

A simple way to fix the NuGet configuration file is to regenerate it. In a file explorer window, go to %AppData%\NuGet. Rename or delete the NuGet.Config file. When you build your Godot project again, the file will be automatically created with default values.

oh yeah, and the C# extension, you need a C# extension. And MONO SDK for the extension to work. Or maybe that's just for linux, which I'm on.

Warning
You need to (re)build the project assemblies whenever you want to see new exported variables or signals in the editor. This build can be manually triggered by clicking the Build button in the top right corner of the editor.

You will also need to rebuild the project assemblies to apply changes in "tool" scripts.

and here's the button for building the project.

    Jesusemora I only said that you don't need an external editor to write C# scripts. Which is true.

    Watch out not to overwhelm the OP with information torrents 😉

    also i didnt follow the Documentation's instruction to setup C# with godot , i actually tried to follow the instruction from a video of this youtuber called Gamesfromscratch , here it is
    Also , i *wasnt *able the tutorial completely , and in fact , the only way i found out that i could link godot to vs code through the editor settings was by accident ! And it worked fine .... until now .

    Jesusemora
    well it was the tasks.json part i was having a problem in when i was following gamesfromscratch's video , i think i should have paid heed to it 💀

    I have installed an older version of godot ( godot 3..5.3) , and c# seems to be working fine there , although i dont know how to setup vs code there , i am more than willing to adjust

    • xyz replied to this.

      averageCOMRE Try to run a C# script in a fresh project, without any VSC involvement. That way you'll know if the issue is with Godot or with VSC setup.

      well it did
      i wrote a code which printed "hello world" [ GD.print( "Hello world" ) ], in the default text editor of godot , and it ran fine . so this means that there is problem with the setup of vs code , but please do keep in mind that i did this in godot 3.5.3

      • xyz replied to this.

        averageCOMRE I meant to try it in the exact version you were setting up VSC for.

        well in that case i had already did it
        it didnt work

        • xyz replied to this.

          averageCOMRE well in that case i had already did it
          it didnt work

          You've typed a simple C# script directly into Godot's text editor in a completely fresh project? Then rebuild and pressed play?

          It "didn't work" in what way?

          well yes , it is giving the same error as before , that it could not instance the script because the associated class could not be found

          • xyz replied to this.
            a month later

            the problem seems to have magically solved itself , i can now run scripts c# nicely . Although i have a bit of a doubt , how do i balance game dev and c# coding in general? Like game dev is my main priority but making c# applications seems hella cool to me aswell , i just want a way to balance both these things nicely .
            Also sorry for being inactive for so long, got carried away by school work