stride icon indicating copy to clipboard operation
stride copied to clipboard

Can't properly reload text files after changes was made in Visual Studio.

Open Wondiws98 opened this issue 8 months ago • 15 comments

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:

  1. Create a project
  2. Open the project in Visual Studio
  3. Edit a .cs file in Visual Studio
  4. Check Stride Game Studio

Additional context Just go into Stride yesterday, hyped to get into it. Just wish i could use Visual Studio.

Wondiws98 avatar Apr 25 '25 17:04 Wondiws98

i cant reproduce this, you can ping me in discord to investigate it further

IXLLEGACYIXL avatar Apr 25 '25 17:04 IXLLEGACYIXL

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.

Doprez avatar Apr 25 '25 17:04 Doprez

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

IXLLEGACYIXL avatar Apr 25 '25 17:04 IXLLEGACYIXL

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.

Doprez avatar Apr 25 '25 17:04 Doprez

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.

Kryptos-FR avatar Apr 26 '25 07:04 Kryptos-FR

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.

Wondiws98 avatar Apr 26 '25 14:04 Wondiws98

https://github.com/user-attachments/assets/21b2f1e1-828c-4592-ad58-84967f0ab624

Wondiws98 avatar Apr 26 '25 15:04 Wondiws98

if you dont have the in engine editor open does it work then?

IXLLEGACYIXL avatar Apr 26 '25 16:04 IXLLEGACYIXL

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.

Wondiws98 avatar Apr 26 '25 16:04 Wondiws98

game studios editor reload wasnt reworked, and its out of date version

try to make it solely with visual studio

IXLLEGACYIXL avatar Apr 26 '25 16:04 IXLLEGACYIXL

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.

Wondiws98 avatar Apr 26 '25 16:04 Wondiws98

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.

Image

Wondiws98 avatar Apr 26 '25 16:04 Wondiws98

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

IXLLEGACYIXL avatar Apr 26 '25 16:04 IXLLEGACYIXL

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.

Wondiws98 avatar Apr 26 '25 16:04 Wondiws98

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

IXLLEGACYIXL avatar Apr 26 '25 16:04 IXLLEGACYIXL