Strange exception with file access and explorator windows
问题 Consider this simple program: private static void Main(string[] args) { var directoryName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Directory"); if (Directory.Exists(directoryName)) Directory.Delete(directoryName, true); Directory.CreateDirectory(directoryName); var stream = File.Create(Path.Combine(directoryName, "File")); //throws stream.Close(); } This works fine while you simply execute this program. The strange thing happens if you browse that