Skip to content

An item with the same key has already been added. Key: res://MainFile.cs#9

Merged
Alchyr merged 1 commit intoAlchyr:masterfrom
SyraLessThanThree:master
Mar 27, 2026
Merged

An item with the same key has already been added. Key: res://MainFile.cs#9
Alchyr merged 1 commit intoAlchyr:masterfrom
SyraLessThanThree:master

Conversation

@SyraLessThanThree
Copy link
Copy Markdown
Collaborator

@SyraLessThanThree SyraLessThanThree commented Mar 22, 2026

When Godot.Bridge.ScriptManagerBridge.LookupScriptsInAssembly(Assembly.GetExecutingAssembly()); is added to the MainFile all .cs files are also added to the godot filesystem.
So there is gonna be an error
An item with the same key has already been added. Key: res://MainFile.cs
when multiple Mods have Godot.Bridge.ScriptManagerBridge.LookupScriptsInAssembly(Assembly.GetExecutingAssembly());
and .cs files of the same name in the same Location.

In the Templates that specifically happens with MainFile.cs.

Moving them to the folder of the modname would fix that unless they have the same name (in which case we have bigger problems anyway).

@SyraLessThanThree
Copy link
Copy Markdown
Collaborator Author

SyraLessThanThree commented Mar 22, 2026

The error doesn't change behavior in any way and all the mods still work as intended.
But it shows that mods loaded with errors which can be confusing so this would be a better approach.

@Alchyr Alchyr merged commit 5aca1c2 into Alchyr:master Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants