0 votes

The following issues have potentially the same cause. They are linked to recognition of C# scripts in the resource folder.

1) Making a script with the same name as another script with different case (e.g. DELETEME.cs x DeleteMe.cs) is allowed, but when I try to build the project, I get an error:

 C:\Program Files
(x86)\MSBuild\14.0\Bin\amd64\Microsot.CSharp.Core.targets(67,5): The
 item "DELETEME.cs" was specified more than once in the "Sources"
 parameter. Duplicate items are not supported by the "Sources"
parameter.

I deleted the script and erased all dependencies. Yet, the error still persists. The file "Microsoft.CSharp.Core" contains nothing specific for my project which leads me to believe that the "memory" of the said script is still somewhere in my project files. I just do not know where...

2) Deleted C# script will still be expected to exist in the res\: folder. In short, I get an error: could not be found. This forces me to create a script with identical name just to prevent this error.

3) Script that was not created in it's original project (e.g. was copied from another project) will not be recognized in the build. You have to attach it to a node to get recognized, even if the script does not extend any of Godot node objects.
This one is minor, but still surprising. I stumbled on it when I tried to create new project and copy/paste my scripts from the previous one.

The expected behaviour of the editor would be permanent update of internal/invisible dependencies. Is there a was to manually correct them?

in Engine by (18 points)
edited by

1 Answer

0 votes

Hi,
This is the first thing that I stumbled upon when encountering 1) and I found a manual solution:
1. Go to your project folder.
2. Open YourProjectName.csproj in any text editor, in my case notepad++
3. Scroll down, or use Find (ctrl+f), to find <Compile Include="DELETEME.cs" /> and delete the extra different case variant that you don't want/need.
4. Save the file and try to build the project again in the editor.

by (14 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.