SDK "Godot.NET.Sdk/4.2.2 not found

Godot Version 4.2.2

Question

Hi

I’m trying to use C# to code my scripts in Godot. I created a blank C# script and when i hit play, i get an error message that basically says SDK "Godot.NET.Sdk/4.2.2 not found. I really don’t know how to fix this, as i only started using Godot and C#. I downloaded dotnet 8.0.303 and 6.0.424. Both don’t work. Any help would be appreciated as I’m just starting to learn.

You should download Visual Studio 2022 (or VS 2019).
Then configure it as your external editor under Editor > Editor Settings > DotNET > Editor

Once that is set, when you double-click on a .cs file inside the Godot IDE, you’ll get Godot open up Visual studio for you.

Inside Visual Studio Right click on your project > Properties
Then set either .NET 6.0 or 8.0 for the target framework

If you want to debug C#, you can start the app in the Godot editor then once it’s up you can use ‘Attach to process’ inside Visual Studio.

P.S.
I find that C# development slows me down in Godot and that the Godot editor + GDScript is a noticeably better development experience.
But sometimes C# is just really nice to be able to use.