Skip to content
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

Closed
ghost opened this issue Oct 26, 2017 · 11 comments
Closed

Comments

@ghost
Copy link

ghost commented Oct 26, 2017

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.

@ghost ghost changed the title Mono: Building project solution doesn't detect that .cs files were deleted Mono: Building project solution doesn't detect that .cs scripts were deleted Oct 26, 2017
@akien-mga akien-mga added this to the 3.0 milestone Oct 26, 2017
@Zylann
Copy link
Contributor

Zylann commented Oct 26, 2017

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.

@ghost
Copy link
Author

ghost commented Oct 26, 2017

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.

@Zylann
Copy link
Contributor

Zylann commented Oct 26, 2017

@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 we want the C# workflow to work without an IDE, that means we need to recode every .csproj configuration abilities into Godot (library references, #defines, compiler flags, maybe more...) and also have Godot keep them in sync if they get modified from IDE.

@neikeq
Copy link
Contributor

neikeq commented Oct 26, 2017

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

@11clock
Copy link

11clock commented Dec 22, 2017

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.

@Zylann
Copy link
Contributor

Zylann commented Dec 22, 2017

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

@akien-mga
Copy link
Member

akien-mga commented Jan 6, 2018

Related to #12917 (same bug/fix, different symptom I'd say).

@neikeq
Copy link
Contributor

neikeq commented Jan 6, 2018

Waiting on #10946 in order to fix #12415 and #12917.

@Nufflee
Copy link
Contributor

Nufflee commented Jul 18, 2018

I can try working on this, I'll try to make it not regenerate or overwrite the .csproj file.

@reduz
Copy link
Member

reduz commented Sep 5, 2018

@neikeq what should we do with this?

@akien-mga
Copy link
Member

Duplicate of #12917.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants