Quick answer: Godot 4 C# source generator failing to regenerate after a .csproj edit? IDE caches stale - close and reopen the solution.

Added a new analyzer reference. Source-generated code is missing; new symbols not available.

Reload solution

Close VS/Rider; reopen. Source generator picks up the .csproj change.

Or restart Godot

Editor also caches. Restart triggers re-resolution.

Touch a .cs file

Modify any source file. Triggers incremental compile; generator may re-run.

“Source generators run at compile. Compile depends on tool state.”

If your project relies on source generators, document the cache-bust steps. New contributors will discover them otherwise.

Related reading