ファイルシステム上のファイルの読み取りと書き込みにトランザクション NTFS を使用していますが、アプリの再起動によってのみ解決される断続的な障害がアプリケーションで発生することに気付きました。エラーのスタック トレースは次のとおりです。
System.Runtime.InteropServices.COMException (0xD0190052): Exception from HRESULT: 0xD0190052
at ...KtmTransactionHandle.IKernelTransaction.GetHandle(IntPtr& handle)
at ...KtmTransactionHandle.CreateKtmTransactionHandle(Transaction managedTransaction)
at ...KtmTransactionHandle.CreateKtmTransactionHandle()
at ...TransactedFile.Open(String path, FileMode mode, FileAccess access, FileShare share)
at ...TransactedFile.ReadAllText(String path)
IKernelTransaction は、ハンドルを取得する COM インターフェイスです。
[ComImport]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("79427A2B-F895-40e0-BE79-B57DC82ED231")]
private interface IKernelTransaction
{
void GetHandle([Out] out IntPtr handle);
}
ここ
IKernelTransaction tx = (IKernelTransaction)TransactionInterop.GetDtcTransaction(Transaction.Current);
私のコードはhttp://msdn.microsoft.com/en-us/library/cc303707.aspxに非常に似ています
問題は、この COM エラー 0xD0190052 に関する情報が見つからないことです。このエラー コードが何であるかを知るだけでも、非常に役立ちます。
ありがとう