--- trunk/MSBuild_CurrentVersion/Program.cs 2012/05/28 10:31:29 191 +++ trunk/MSBuild_CurrentVersion/Program.cs 2012/05/28 10:34:02 192 @@ -25,7 +25,9 @@ namespace MSBuild_CurrentVersion string version_file = "current-version.txt"; string full_path = string.Format(@"{0}\{1}", asm_path,version_file); - using (FileStream fs = new FileStream(full_path, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite)) + FileInfo fi = new FileInfo(full_path); + if (fi.Exists) fi.Delete(); + using (FileStream fs = new FileStream(full_path, FileMode.CreateNew, FileAccess.ReadWrite, FileShare.ReadWrite)) { StreamWriter sw = new StreamWriter(fs); sw.AutoFlush = true; |