-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mono: Building project solution doesn't detect that .cs scripts were deleted #12415
Comments
I thought this was by design? I asked to @neikeq on Discord a few days ago, and Godot doesnt overwrite the solution everytime a script is added or removed, which is good because it lets you configure the solution the way you want (unless you use no C# IDE of course...). What you describe happens to any C# project anyways, like if you delete a .cs file outside of the project, it obviously fails once you try to build. |
Oh, okay. But this happens even when I delete scripts from FileSystem tab (right click - delete). I was thinking that when deleting from inside of the project it could edit the .csproj so the project can run from the editor. |
@MrMaidx Ah sorry I was ambiguous: if you delete it from Godot or a file explorer it won't update the csproj, but it will update if you use an IDE in which you do it (which the majority of C# coders are using). That was my point in fact, because unlike GDScript, C# needs a .csproj file to build, which is usually edited from an IDE. |
If the file is deleted from the file system, then we should remove it from the project. It just wasn't done yet. There is also the problem that when you remove a C# file outside of Godot, then it becomes a built-in script in Godot, which shouldn't happen... |
I honestly think a lot of problems would be solved if the solution was just regenerated before every play. Delete them and then generate them again. |
@11clock please no, that would be unnecessary half of the time. A more appropriate time is when a C# file is added, changed or removed (so only when compiling would actually make a difference). Unity does exactly that, even though I still dislike it: project gets overwritten, csproj options you might want to set in your IDE get lost, no way to use custom build system or multi-projects and have to wait everytime for compilation process which can take a while on a large project). Maybe Godot can do it better... |
Related to #12917 (same bug/fix, different symptom I'd say). |
I can try working on this, I'll try to make it not regenerate or overwrite the .csproj file. |
@neikeq what should we do with this? |
Duplicate of #12917. |
Operating system or device, Godot version, GPU Model and driver (if graphics related):
Windows 10, VS2017 amd64 compiler, latest master 2987e6c
Issue description:
When I delete .cs scripts (even from the editor) it seems that .csproj file is not automaticaly edited and deleted scripts are still listed there. This results in Build error when trying to run such project because build system cannot find deleted scripts.
When .csproj file is edited by hand and lines with deleted files are removed it seems to run correctly.
I'm not sure if this is a bug or just not implemented feature but an issue for it hopefully won't hurt. :)
Steps to reproduce:
Create a .cs script in any project.
Delete said script.
Running the project will result in Build error.
The text was updated successfully, but these errors were encountered: