-
- RisingSunStudios
- Posts: 21
- Joined:
Xaml file reverted by UnityEditor?
So this is a weird one.. I spent several hours last night working within a single Xaml file in my Unity project. All is well. This morning, I load the project and all my changes from the previous evening are gone. It was the only Xaml file using an Ellipse control, and searching in my entire project directory comes up empty for usages of Ellipse.
I was saving the file regularly as I was using the hot reload to view the changes. I was editing it within Visual Studio Code. I hadn't committed the file to source control and use git not Unity's source control, so there's no involvement or discarding of changes done by me.
The only thing I can think of, is that there is some caching of files happening and a previous version was loaded and overwrite the newer version? Or a bug within Rider 2025 where it didn't reload the file from disk after changes, and saved it's current version. Or I am going absolutely crazy.
Has this been seen before?
edit - actually, now that I think about it, I think this has been seen before using Rider 2025.. Okay lesson learnt, don't open the Xaml in both VSCode and Rider at same time!
I was saving the file regularly as I was using the hot reload to view the changes. I was editing it within Visual Studio Code. I hadn't committed the file to source control and use git not Unity's source control, so there's no involvement or discarding of changes done by me.
The only thing I can think of, is that there is some caching of files happening and a previous version was loaded and overwrite the newer version? Or a bug within Rider 2025 where it didn't reload the file from disk after changes, and saved it's current version. Or I am going absolutely crazy.
Has this been seen before?
edit - actually, now that I think about it, I think this has been seen before using Rider 2025.. Okay lesson learnt, don't open the Xaml in both VSCode and Rider at same time!
Re: Xaml file reverted by UnityEditor?
As far as I know, our tools never automatically overwrite XAML files. However, issues like this can happen if the same file is opened in multiple editors, like VS Code and Rider, at the same time. If you modify the file in both editors independently, then save, one editor might overwrite the other's changes without warning, depending on how they handle file syncing or change detection.edit - actually, now that I think about it, I think this has been seen before using Rider 2025.. Okay lesson learnt, don't open the Xaml in both VSCode and Rider at same time!
In VS Code, this typically triggers a conflict warning, but I'm not sure how Rider 2025 handles this situation. It's possible that if Rider didn't reload the file after changes were made in VS Code, then saved its cached version, it could have overwritten the newer content.
That said, this kind of overwrite should still require a manual save to occur. Could you confirm whether you had both editors open and if the file was saved manually in Rider at any point after making changes in VS Code?
-
- RisingSunStudios
- Posts: 21
- Joined:
Re: Xaml file reverted by UnityEditor?
I definitely had the file open in both Rider and VSCode, and as I was shutting down the pc I didn't pay much attention to rider. Up until then I was only making changes to the file in VSCode and using Rider for the code-behind and view models. I am pretty sure the file was open in Rider too though not the active tab.
I don't know if something changed in Rider 2025 but it doesn't seem to automatically reload the file immediately and displays a "Reload File" command in the corner. I didn't think twice and closed Rider, so it is possible it then saved the cached version.
I do believe a colleague of mine also lost work (not from NoesisGUI, just WPF changes) due to Rider not reloading the file too, so I'm guessing the same thing happened here. At first I thought it may have been a Unity thing, but no I'm convinced it just a quirk of Rider 2025 and/or my own mistake!
At least the code is always quicker to write the 2nd time around :-)
I don't know if something changed in Rider 2025 but it doesn't seem to automatically reload the file immediately and displays a "Reload File" command in the corner. I didn't think twice and closed Rider, so it is possible it then saved the cached version.
I do believe a colleague of mine also lost work (not from NoesisGUI, just WPF changes) due to Rider not reloading the file too, so I'm guessing the same thing happened here. At first I thought it may have been a Unity thing, but no I'm convinced it just a quirk of Rider 2025 and/or my own mistake!
At least the code is always quicker to write the 2nd time around :-)
Who is online
Users browsing this forum: No registered users and 6 guests