我能够通过WCF(N-Tier)使用同步框架2.1同步两个远程数据库。
为了在传输大数据时提高性能,我实施了批处理。
但我面临以下错误信息:
An unexpected error occurred when applying batch file 1e1855e6-0b9a-4332-9fdb-07a25bc1bd49.batch. See the inner exception for more details.
仅在最后一批文件中发生这种情况。在批处理文件集中应用最后一批文件时,代码将以上述错误消息终止。
下面我粘贴了web服务日志的xml格式(内部异常):
<InnerException>
<ExceptionType>System.IO.FileNotFoundException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
<Message>Could not find file 'c:\windows\system32\inetsrv\1e1855e6-0b9a-4332-9fdb-07a25bc1bd49.batch'.</Message>
<StackTrace>
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode)
at Microsoft.Synchronization.Data.DbSyncBatchInfoFactory.Deserialize(String batchFileName, Boolean deserializeData)
at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ReadBatchFile(UInt32 lookupLocation, UInt32 expectedNumber)
at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ReadBatchFile(UInt32 expectedNumber, String& batchFileName)
at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ApplyBatches(DbSyncScopeMetadata scopeMetadata, DbSyncSession syncSession, SyncSessionStatistics sessionStatistics)
</StackTrace>
<ExceptionString>System.IO.FileNotFoundException: Could not find file 'c:\windows\system32\inetsrv\1e1855e6-0b9a-4332-9fdb-07a25bc1bd49.batch'.
File name: 'c:\windows\system32\inetsrv\1e1855e6-0b9a-4332-9fdb-07a25bc1bd49.batch'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode)
at Microsoft.Synchronization.Data.DbSyncBatchInfoFactory.Deserialize(String batchFileName, Boolean deserializeData)
at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ReadBatchFile(UInt32 lookupLocation, UInt32 expectedNumber)
at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ReadBatchFile(UInt32 expectedNumber, String& batchFileName)
at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ApplyBatches(DbSyncScopeMetadata scopeMetadata, DbSyncSession syncSession, SyncSessionStatistics sessionStatistics)
</ExceptionString>
</InnerException>
非常感谢您的帮助和建议!!
提前感谢你的朋友!!
答案 0 :(得分:0)
尝试将您的批处理目录移出IIS文件夹。