How to manually change 'recognition' of C# scripts in the res:\\ folder

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Trayani

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"

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…

  1. 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.

  2. 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?

:bust_in_silhouette: Reply From: DeadWizard

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.