在我的Preclose.cs文件中,有一部分代码:
clientIds.ForEach(i =>
{
var tempDirectory = Path.GetTempPath() + DateTime.Now.Ticks.ToString() + "\\";
if (!FileSystem.DirectoryExists(tempDirectory))
FileSystem.CreateDirectory(tempDirectory);
var baseDirectory = KnownAliases.Replace(@"\\MASTER_PATH\ftp\ClientUDB\");
var reportDirectory = Path.Combine(baseDirectory, i, "PreClose");
var reportArchive = Path.Combine(reportDirectory, "Archive");
var zipArchive = new ZipForge();
zipArchive.BaseDir = Path.GetTempPath();
zipArchive.InMemory = false;
zipArchive.FileName = String.Format("{0}{1}_{2}.zip", zipArchive.BaseDir, base.ProcessName.Replace(" ", "_"), DateTime.Now.Ticks);
zipArchive.OpenArchive(FileMode.OpenOrCreate);
System.Net.Mail.MailMessage confirmationMsg = null;
...
}
基本上Preclose将在我的服务器上运行,最近我收到了很多"无效的存档文件"我服务器的错误日志中的错误消息。下面是它的堆栈跟踪:
at ComponentAce.Compression.Archiver.DirManager.BuildCentralDirByLocalHeaders (Byte[]& buf)
at ComponentAce.Compression.Archiver.DirManager.LoadDir()
at ComponentAce.Compression.Archiver.BaseArchiver.InternalOpenArchive()
at D2L.AutoProc.Service.Library.PreClose.<Execute>b__1(String i) in d:\Builds\136\Development\Aps\Sources\Trunk\Applications\Aps\D2L.AutoProc.Service.Library\PreClose.cs:line 54
at System.Collections.Generic.List`1.ForEach(Action`1 action)
at D2L.AutoProc.Service.Library.PreClose.Execute() in d:\Builds\136\Development\Aps\Sources\Trunk\Applications\Aps\D2L.AutoProc.Service.Library\PreClose.cs:line 40
第54行是&#34; zipArchive.OpenArchive(FileMode.OpenOrCreate);&#34;我的预关闭文件中的行。 任何想法的家伙?
更多信息: Preclose将在不同的服务器上运行,因此两个服务器可能同时运行这部分代码。