rioil / VRChatLifelog

VRChatのログからJoin/Leave履歴を記録するツール
MIT License
2 stars 0 forks source link

VRChatの起動と同じタイミングで起動するとエラーが発生する #2

Closed rioil closed 6 months ago

rioil commented 2 years ago

既存ファイル読み取り中に,VRChatの起動によって古いファイルが削除されると例外が発生します

2022-05-17 07:22:29.3449 [Error] error occurred System.IO.FileNotFoundException: Could not find file 'C:\Users\rio\AppData\LocalLow\VRChat\VRChat\output_log_22-40-44.txt'.
File name: 'C:\Users\rio\AppData\LocalLow\VRChat\VRChat\output_log_22-40-44.txt'
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at VRChatLogWathcer.Models.LogWathcerService.ReadLogFile(String path) in D:\rio\dev\C#\VRChatLifelog\VRChatLogWathcer\Models\LogWathcerService.cs:line 220
   at VRChatLogWathcer.Models.LogWathcerService.<StartLogFileWatching>b__21_2(String path) in D:\rio\dev\C#\VRChatLifelog\VRChatLogWathcer\Models\LogWathcerService.cs:line 290
   at VRChatLogWathcer.Extensions.IEnumerableExtensions.ForEach[T](IEnumerable`1 items, Action`1 action) in D:\rio\dev\C#\VRChatLifelog\VRChatLogWathcer\Extensions\IEnumerableExtensions.cs:line 15
   at VRChatLogWathcer.Models.LogWathcerService.StartLogFileWatching() in D:\rio\dev\C#\VRChatLifelog\VRChatLogWathcer\Models\LogWathcerService.cs:line 290
   at VRChatLogWathcer.Models.LogWathcerService.ExecuteAsync(CancellationToken stoppingToken) in D:\rio\dev\C#\VRChatLifelog\VRChatLogWathcer\Models\LogWathcerService.cs:line 88
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at VRChatLogWathcer.App.OnStartup(StartupEventArgs e) in D:\rio\dev\C#\VRChatLifelog\VRChatLogWathcer\App.xaml.cs:line 71
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run()
   at VRChatLogWathcer.App.Main() in D:\rio\dev\C#\VRChatLifelog\VRChatLogWathcer\App.xaml.cs:line 31