I am using the zip version of godot engine on Windows 11 and trying to program with CSharp, however, when I try to build the project, it failed. In the MSBuild tab it output the following content. The script is simply outputing a Hello World string in the console.
Could not resolve SDK "Godot.NET.Sdk". Exactly one of the probing messages below indicates why we could not resolve the SDK. Investigate and resolve that message to correctly specify the SDK.
SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" returned null.
Unable to resolve 'Godot.NET.Sdk (= 4.2.2)' for '.NETStandard,Version=v0.0'.
MSB4276: The default SDK resolver failed to resolve SDK "Godot.NET.Sdk" because directory "C:\Program Files\dotnet\sdk\8.0.204\Sdks\Godot.NET.Sdk\Sdk" did not exist. F:\0Documentary\Henry\CODING\Games\CSharpTest\CSharpTest.csproj(0,0)
I’ve installed the latest .NET SDK (8.0.204), and the PATH variable is set, dotnet command can be accessed from the godot directory.
I think the core solution is that to mend the “C:\ProgramFiles\dotnet\sdk\8.0.204\Sdks\Godot.NET.Sdk\Sdk” directory is mentioned in the error information, but I have no idea how to do.
MACHINE:
Windows 10 Education
CPU I7-8750
RAM 16GB
VIDE0: NVIDIA GeForce GTX 1050 Ti
SITUATION;
I have a problem similar to that of only extreme.
I tested it via a virtual machine and on Linux it worked perfectly, only on Windows it doesn’t work.
I switched the installation to .net 6.0 and it didn’t work the same. I tested the installation of dev version 4.3 and with version 3.3 and the error continues.
What should I do?
Thanks a lot.
ERROR MESSAGE:
Unable to resolve 'Godot.NET.Sdk (= 4.2.2)' for '.NETStandard,Version=v0.0'. C:\Pessoal\Godot\csharp-Godot\csharp-Godot.csproj(0,0)
MSB4236: The SDK 'Godot.NET.Sdk/4.2.2' specified could not be found. C:\Pessoal\Godot\csharp-Godot\csharp-Godot.csproj(0,0)
Then open the console (I am on windows so it is cmd) in the folder and typed dotnet restore and wait for it to finish, and now the project could be successfully built.