Unable to Instantiate C# class in GDscript when 'Use Hidden Project Data in Directory' is Enabled

Godot Version

Godot 4.7.2.stable.mono

Preface

I myself resolved this issue, but I wanted to post this because I couldn’t find another topic that matched. So leaving this for whoever else is struggling.

Following the Godot Example Code,
I made a simple test project with the following directory structure:

res
  L xls_test
      L load_cs_script.gd
      L NewScript.cs
      L scene.tcsn 

Problem

I started encountering this error which always crashed my project:

E 0:00:00:650   @implicit_new: Invalid call. Nonexistent function 'new' in base 'CSharpScript'.
  <GDScript Source>load_cs_script.gd:5 @ @implicit_new()
  <Stack Trace> load_cs_script.gd:5 @ @implicit_new()

which would appear once the following line of code was run:

# load_cs_script.gd
extends Node

var MyCSharpScript = preload("res://xls_test/NewScript.cs")
var my_csharp_node = MyCSharpScript.new()

func _ready() -> void:
	my_csharp_node.Foo(); # NewScript.cs has only this public function inside it

var my_csharp_node = MyCSharpScript.new() # <--- CRASH HERE

Plus, using [GlobalClass] wouldn’t show the C# class in the editor.

Fix

As it turns out, for some reason, my project.godot file had disabled hidden directories:

[application]
; ...
config/use_hidden_project_data_directory=false
; ...

Resetting this to default (true) resolved the issue. The tooltip also indicates that without the hidden directory, some things would break, which I guess includes cross-language scripting? I’m not that knowledgeable so maybe someone on this forum can help explain the issue.