Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2015 closing files on file save

So I've tried to find someone else online having the same issue as me, but with little success. I currently have an issue with only Visual Studio 2015 (Using Professional) where by if I have a file open and save it, not only does it auto-close the file from my IDE but it also removes the file from the Solution Explorer.

I have to close and re-open the project for the file to reappear; rinse and repeat every time I save a file and want to re-access it.

I've uninstalled VS 2015 (even ended up uninstalling VS 2017 too), I've used Visual Studio Uninstaller.. And still after reinstalling VS 2015 this issue is still apparent. Are there any settings which may be causing this, or anyone aware of potential fixes/workarounds?

like image 600
MattVon Avatar asked Jan 22 '18 12:01

MattVon


People also ask

How do I close Visual Studio without saving?

If you have not yet done a build and the files are unsaved, then you can just close visual studio and say "no" to all dialogs about saving unsaved changes. There will be an "*" on the code page tab if it is not yet saved.

Where should I save my Visual Studio projects?

If you save the project (File → Save All) then you can choose where to save it. The default is the Projects folder inside your Documents.


Video Answer


1 Answers

The issue here is that Windows expanded its file explorer event list. Visual Studio listens to these events. For some reason, when it receives a "file updated" event, Visual Studio thinks it's a "file deleted" event and acts accordingly.

Most answer focus on using a different version of Windows or Visual Studio, which (in my opinion) isn't a solution, it's avoiding the problem. This hotfix, however, fixed the issue in VS2015 for me.

like image 87
Flater Avatar answered Sep 20 '22 15:09

Flater