diff options
author | Matt Ward <matt.ward@microsoft.com> | 2019-12-13 13:13:58 +0300 |
---|---|---|
committer | Matt Ward <ward.matt@gmail.com> | 2020-01-14 12:36:01 +0300 |
commit | d2ff688d5979436c18124d9740a23a831bbb59ae (patch) | |
tree | 8badab3289c6c74405d49c29848a2259b5c0a75c | |
parent | 97e486c9fbd040f504794f21834ccfff6efb494f (diff) |
[Core] Handle odd file watcher events causing solution to be closed
The file watcher seems to sometimes produce strange events which
look like a directory being renamed to a file. This can cause the
IDE to believe the solution file has been deleted since the file
service will raise a FileRemoved event for a rename. To avoid this
check that the directory does not exist and if it does the FileRemoved
event is not fired with this type of rename.
Fixes VSTS #1027550 - VSMac keeps closing my solution
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Projects/FileWatcherService.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/FileWatcherService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/FileWatcherService.cs index c2bf45fd01..b438d3e13d 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/FileWatcherService.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/FileWatcherService.cs @@ -585,7 +585,8 @@ namespace MonoDevelop.Projects // the original file still exists.
if (File.Exists (e.OldFullPath))
FileService.NotifyFileChanged (e.OldFullPath);
- else
+ // Handle odd file watcher events which look like a folder being renamed to a file.
+ else if (!Directory.Exists (e.OldFullPath))
FileService.NotifyFileRemoved (e.OldFullPath);
}
|