Godot Version
Godot 4.6.1
Question
c# GD.LOAD() Fails, but file exists at path?
ERROR: Cannot instantiate C# script because the associated class could not be found.
I have a godot .net project with this project structure (with irrelevant files omitted):
gamename.slnx
gamename.csproj ← Sdk=“Godot.NET.Sdk/4.6.1”
`gamename.Client` ← <Project Sdk="Microsoft.NET.Sdk">
`ClientRoot.cs`
`ClientRoot.tscn` ← this scene references the script
`gamename.Client.csproj`
`gamename.Shared` ← <Project Sdk="Microsoft.NET.Sdk">
`gamename.Shared.csproj`
`gamename.Server` ← <Project Sdk="Microsoft.NET.Sdk">
`gamename.Server.csproj`
Inside gamename.Shared I call a GD.Load("res://Snowdrift.Client/ClientRoot.tscn") and its unable to find this path even though they do exist in the project structure (client root scene references the following script) :
ERROR: Cannot instantiate C# script because the associated class could not be found. Script: 'res://Snowdrift.Client/ClientRoot.cs'. Make sure the script exists and contains a class definition with a name that matches the filename of the script exactly (it's case-sensitive).
at: can_instantiate (modules/mono/csharp_script.cpp:2360)
blah blah blah
why can GD.Load not find this file? it exists at the path.
Is it namespacing?
the root project is configured to ignore the sub projects files so they are not included into source twice while I can still load the dlls via project reference.
<ItemGroup> <Compile Remove="Snowdrift.Engine/**/*.cs" /> <Compile Remove="Snowdrift.Shared/**/*.cs" /> <Compile Remove="Snowdrift.Client/**/*.cs" /> <EmbeddedResource Remove="Snowdrift.Engine/**" /> <EmbeddedResource Remove="Snowdrift.Shared/**" /> <EmbeddedResource Remove="Snowdrift.Client/**" /> <None Remove="Snowdrift.Engine/**" /> <None Remove="Snowdrift.Shared/**" /> <None Remove="Snowdrift.Client/**" /> </ItemGroup>
does the Sdk=“Godot.NET.Sdk/4.6.1” project require that the files are compiled into its own assembly?




