Can't run scene due to "error CS0234" when building c# script

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By hollow_knight

hi, I’m following the getting-started tutorial and am running in to an issue when running a scene. My C# script fails to build with this error:

error CS0234: The type or namespace name 'Dataflow' does not exist in the namespace 'System.Threading.Tasks' (are you missing an assembly reference?)

I have the dotnet 7.0 sdk installed and vs code is pointing to it. I also have Godot using the dotnet cli for builds but switching to MSBuilds doesn’t seem to help.

:bust_in_silhouette: Reply From: juppi


even if you have .NET 7 installed, Godot uses Mono internally.
Like Microsoft says, you may wanna add this as nuget package:

dotnet add package System.Threading.Tasks.Dataflow

Thank you juppi, this worked perfectly :slight_smile:

hollow_knight | 2023-01-17 21:06