Quick answer: Godot 4 C# needs the matching .NET SDK installed (typically net8.0). Confirm with dotnet --version, run dotnet workload restore for mobile workloads, and ensure the .csproj TargetFramework matches what the editor expects.
Here is how to fix Godot 4 .NET exports failing with cryptic mono build errors, PDB warnings, or “Could not find SDK” messages. The Godot 4 C# binding requires a separate .NET SDK installation and version-matched targeting; the toolchain does not ship inside Godot itself. Most failures trace back to missing or mismatched SDKs.
The Symptom
Project → Export → Android (or any platform) shows error like “Build failed” with mono / dotnet messages in the output log. PDB warnings about missing symbols. Or .csproj refuses to compile in Visual Studio with TargetFramework errors.
What Causes This
SDK not installed. Godot 4 .NET expects the .NET SDK on PATH. Pure runtime is not enough.
Version mismatch. Editor compiled against net8.0; project SDK is net6.0. Targets do not align; build fails.
Mobile workload missing. Android/iOS targets need additional workloads not installed by default.
Wrong TargetFramework in csproj. Manual edits or template version drift can leave the wrong target.
The Fix
Step 1: Install matching .NET SDK.
# Confirm current
dotnet --version
dotnet --list-sdks
# If wrong, install from https://dot.net
# Typical for Godot 4: net8.0
Step 2: Match TargetFramework in csproj.
<!-- MyProject.csproj -->
<Project Sdk="Godot.NET.Sdk/4.3.0">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading>
</PropertyGroup>
</Project>
Step 3: Restore workloads for mobile.
# In the project root
dotnet workload restore
# Or specifically:
dotnet workload install android ios
This installs platform-specific build tools.
Step 4: Clean and rebuild.
dotnet clean
dotnet build -c ExportRelease
# Then export from Godot editor
Step 5: Use the editor MSBuild output panel. Godot has a MSBuild tab at the bottom showing detailed build logs. Errors here precede the export failure; fixing them unblocks export.
Common PDB Warnings
PDB (program database) warnings about missing symbols are usually safe to ignore for release builds. If they cause the export to fail, set <DebugType>portable</DebugType> in csproj and rebuild.
Single File Publish For Smaller Builds
For desktop, single-file publish reduces output size:
<PropertyGroup>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>true</SelfContained>
</PropertyGroup>
Combine with the export preset’s embedded SDK option for cleanest distribution.
“Match SDK version. Restore workloads for mobile. csproj TargetFramework aligns with editor. Clean rebuild and export succeeds.”
Related Issues
For Android keystore export, see Android Keystore. For PCK encryption, see PCK Encryption.
SDK installed. Version matched. Workloads restored. csproj clean. Export builds.