Failling to build project after using Autoload

Godot Version

v4.2.2-stable_mono

Question

I’m using godot with VSCode as IDE and codding in C#. I started a new project to learn about godot, everything was fine until I had this problem of building project.

I usualy used the run button of the Godot editor for previewing, but I missclicked on VSCode run button, and since builder doesn’t work anymore. I tried with new project, no problem until I add autoload.

When I add and autoload I got this error :

  Failed to create an autoload, script 'res://Autoload/Game.cs' does not inherit from 'Node'.
  editor/editor_autoload_settings.cpp:550 - Condition "!info->node" is true. Continuing.

After that, event if I delete autoload I always have thoses messages :

.godot\mono\obj\Debug\Godot.sourceGenerators\Godot.SourceGenerators.ScriptSignalsGenerator\Event_ScriptSignals.generated.cs (8 issues)
CS1519: Invalid token '=' in class, record, struct, or interface member declaration D:\Godot\RogueLikeNew\.godot\mono\temp\obj\Debug\Godot.SourceGenerators\Godot.SourceGenerators.ScriptSignalsGenerator\Event_ScriptSignals.generated.cs(18,62)
CS1001: Identifier expected D:\Godot\RogueLikeNew\.godot\mono\temp\obj\Debug\Godot.SourceGenerators\Godot.SourceGenerators.ScriptSignalsGenerator\Event_ScriptSignals.generated.cs(30,42)
CS1001: Identifier expected D:\Godot\RogueLikeNew\.godot\mono\temp\obj\Debug\Godot.SourceGenerators\Godot.SourceGenerators.ScriptSignalsGenerator\Event_ScriptSignals.generated.cs(42,46)
CS1001: Identifier expected D:\Godot\RogueLikeNew\.godot\mono\temp\obj\Debug\Godot.SourceGenerators\Godot.SourceGenerators.ScriptSignalsGenerator\Event_ScriptSignals.generated.cs(54,35)
CS1001: Identifier expected D:\Godot\RogueLikeNew\.godot\mono\temp\obj\Debug\Godot.SourceGenerators\Godot.SourceGenerators.ScriptSignalsGenerator\Event_ScriptSignals.generated.cs(67,39)
CS0117: 'Event.SignalName' does not contain a definition for '' D:\Godot\RogueLikeNew\.godot\mono\temp\obj\Debug\Godot.SourceGenerators\Godot.SourceGenerators.ScriptSignalsGenerator\Event_ScriptSignals.generated.cs(30,42)
CS0117: 'Event.SignalName' does not contain a definition for '' D:\Godot\RogueLikeNew\.godot\mono\temp\obj\Debug\Godot.SourceGenerators\Godot.SourceGenerators.ScriptSignalsGenerator\Event_ScriptSignals.generated.cs(54,35)
CS0117: 'Event.SignalName' does not contain a definition for '' D:\Godot\RogueLikeNew\.godot\mono\temp\obj\Debug\Godot.SourceGenerators\Godot.SourceGenerators.ScriptSignalsGenerator\Event_ScriptSignals.generated.cs(67,39)


An a second line almost the same but with this path :
.godot\mono\obj\Debug\Godot.sourceGenerators\Godot.SourceGenerators.ScriptSerializationGenerator\Event_ScriptSerialization.generated.cs (4 issues)

I absolutly don’t know how to fix this. As I said it worked nicely event with autoload, no error at all in the output, it started when I misclicked on VSCode run button. And even with a fresh new project, the problem persist as soon as I want to add autoload (until I don’t use autoload, it works well). In addition, if I run the game from the project list in godot, it works perfectly. And if Y “continue debugging anyway” in VSCode after the mentionned errors, it also works.

If anyone have an idea how to fix this, I’d be very grateful

your autoload script should have extends Node at very least

Thanks for your answer.
Both of my autoload script extends Node

public partial class Event : Node

It worked very well until I ran the project on VSCode

did your autoload script file also named as “Event.cs”?
if not, try change it to have the same name like your partial class name. then rebuild

Yes it does
I assume the problem is with the builder himself or some component of .Net, like if some configuration is wrong or file missing. Bur absolutely can’t find exactly what. Event if I delete all autoload il the setting, delete the .cs files, the project won’t build anymore as soon as I had one time the errors. But if I create a new project, it’s working.

Finally found the problem !
As often it was very basic problem, but looked for something complicated !

for the record, the problem was here :

[Signal] public delegate void 
b_coinEventHandler();

instead of

[Signal] public delegate void nb_coinEventHandler();

So the problem wasn’t misclick on the run button but in my line of code.

Thank-you for your help :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.