dhzdhd / W11-MediaPlayerRPC

Discord RPC for the new Windows 11 Media Player
6 stars 3 forks source link

Unhandled exception. System.TypeInitializationException #3

Closed krnlexception closed 12 months ago

krnlexception commented 1 year ago

Unhandled exception. System.TypeInitializationException: The type initializer for '<StartupCode$MediaPlayerRPC>.$Program' threw an exception.
 ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\a\W11-MediaPlayerRPC\W11-MediaPlayerRPC\MediaPlayerRPC\settings.json'.
   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 FSharp.Data.Runtime.IO.asyncRead@237-5.Invoke(Unit unitVar)
   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvoke[T,TResult](AsyncActivation`1 ctxt, TResult result1, FSharpFunc`2 part2) in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 447
   at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 104
--- End of stack trace from previous location ---
   at Microsoft.FSharp.Control.AsyncResult`1.Commit() in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 393
   at Microsoft.FSharp.Control.AsyncPrimitives.QueueAsyncAndWaitForResultSynchronously[a](CancellationToken token, FSharpAsync`1 computation, FSharpOption`1 timeout) in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 1045
   at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronously[T](CancellationToken cancellationToken, FSharpAsync`1 computation, FSharpOption`1 timeout) in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 1071
   at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken) in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 1366
   at <StartupCode$MediaPlayerRPC>.$Program..cctor() in D:\a\W11-MediaPlayerRPC\W11-MediaPlayerRPC\MediaPlayerRPC\Program.fs:line 23
   --- End of inner exception stack trace ---
   at MediaPlayerRPC.Program.main(String[] args) in D:\a\W11-MediaPlayerRPC\W11-MediaPlayerRPC\MediaPlayerRPC\Program.fs:line 188```
dhzdhd commented 12 months ago

I have migrated from json to LiteDB so this should not be a problem anymore