Can't properly reload text files after changes was made in Visual Studio.
Release Type: Official
Version: 4.2.0.2381
Platform(s): Windows 11
Describe the bug Can't get Stride text editor to reload assemblies properly when changing and saving .cs files in the latest Visual Studio 2022 v17.13.
Whenever i edit a .cs file in Visual Studio and save it, Stride prompts me and asks whether i want to reload it or not. When i click on "reload", nothing changes. None of the changes i made in Visual Studio appears. This is weird because when i edit the .cs file in other text editors like NotePad++, i get prompted and when i click "reload", it works as expected. Also, when i make changes in Visual Studio, NotePad++ prompts me and reloading the text file works as expected too.
Only when i edit and save a text file in Visual Studio and try to reload it in Stride do i get this issue.
I've tried reinstalling Stride, updating Visual Studio, updating .Net and restarting my computer.
To Reproduce Steps to reproduce the behavior:
- Create a project
- Open the project in Visual Studio
- Edit a .cs file in Visual Studio
- Check Stride Game Studio
Additional context Just go into Stride yesterday, hyped to get into it. Just wish i could use Visual Studio.
i cant reproduce this, you can ping me in discord to investigate it further
To add on to this I may have a similar error when I delete files in Visual Studio that were previously saved in the project and loaded in GameStudio, it will not properly remove the files in GameStudio. I'm wondering if the issue is with locked resources on the host machine?
Although when I do that it will throw an error in GameStudio saying it couldn't delete the code files and just readds them for me to remove them in GameStudio. Reloading GameStudio is the work around currently for me but I am used to working primarily in Visual Studio first.
To add on to this I may have a similar error when I delete files in Visual Studio that were previously saved in the project and loaded in GameStudio, it will not properly remove the files in GameStudio. I'm wondering if the issue is with locked resources on the host machine?
Although when I do that it will throw an error in GameStudio saying it couldn't delete the code files and just readds them for me to remove them in GameStudio. Reloading GameStudio is the work around currently for me but I am used to working primarily in Visual Studio first.
is this recent? nobody changed the reloading trigger code recently
https://github.com/stride3d/stride/commit/5da9ae357eb795e99616e8d528bf295e1fa2c3c9#diff-5fd6e36fc2f597e8c0caa77ad38791bf11d2e3080212659b99faec86070fa6dc maybe this ? i didnt use stride recently but i cant remember having trouble reloading or deleting files
is this recent? nobody changed the reloading trigger code recently
No, this has been happening for a while. I'm not 100% sure this is the same as the above issue but it sounded fairly similar. It's semi inconsistent which is where I am thinking it could be a locked file that may be in the wrong state.
Visual Studio does some of the changes in memory and only commits them to the disk when you do Save All. GameStudio monitors file change on the disk. There isn't much we can do on our side unfortunately.
Visual Studio does some of the changes in memory and only commits them to the disk when you do Save All. GameStudio monitors file change on the disk. There isn't much we can do on our side unfortunately.
I don't think that's true because other text editors detects changes made in Visual Studio.
When I save a text file in Visual Studio, NotePad++ prompts me to reload the file and it works just as expected while if I do the same in GameStudio I do get prompted but none of the changes appear.
Visual Studio do commits changes to the disk when I hit the "save" button.
https://github.com/user-attachments/assets/21b2f1e1-828c-4592-ad58-84967f0ab624
if you dont have the in engine editor open does it work then?
if you dont have the in engine editor open does it work then?
You mean if I don't have the file opened in the Game Studio's text editor?
I still get the issue, even without the file opened in Game Studio.
I get asked to reload, I hit "reload", then I open the file in the Game Studio text editor to check on it and no there are no changes.
game studios editor reload wasnt reworked, and its out of date version
try to make it solely with visual studio
But why does it works with other text editors?
If i make and save changes in NotePad++, Game Studio reloads the content without any problems.
Also I've noticed that the Game Studio is aware of the content of the reloaded files.
For instance, Game Studio warns me of syntax errors i make in Visual Studio after reloading. Even tho none of those syntax error appear in the loaded file itself.
maybe the broadcasted file changed event is different, you can look into projectwatcher and check which file events get broadcasted towards GameStudio ( that the button appears ) and the built in editor dependent on the editor is used
the built in editor is not in the best shape..
the built in editor is not in the best shape..
I get it, thanks for the help. I'll try to find a way around it or just live with it. I guess it's not that big a deal anyway.
the built in editor is not in the best shape..
I get it, thanks for the help. I'll try to find a way around it or just live with it. I guess it's not that big a deal anyway.
the built in editor is roslynpad and nobody managed to upgrade it yet, as its still on a "old version" , when the avalonia rewrite happens it may be easier to integrate roslynpad and make it upgradable ...more or less roslynpad is on .NET6 and couldnt be updated since so its ..buggy... visual studio itself with game studio and no roslynpad should work without problems