GI-cutscenes icon indicating copy to clipboard operation
GI-cutscenes copied to clipboard

System.IO.InvalidDataException: Failed to load configuration from file 'D:\GICutscenes\appsettings.json'.

Open MoonNight6716 opened this issue 1 year ago • 11 comments

image

MoonNight6716 avatar Mar 11 '23 08:03 MoonNight6716

我已经把 appsettings.json 更新了一遍

MoonNight6716 avatar Mar 11 '23 08:03 MoonNight6716

I have the same issue after updating to 0.5.0

System.IO.InvalidDataException: Failed to load configuration from file 'I:\Temp\GICutscenes\appsettings.json'.
 ---> System.TypeLoadException: Method 'GetSpan' in type 'System.Text.Json.PooledByteBufferWriter' from assembly 'System.Text.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' does not have an implementation.
   at System.Text.Json.JsonDocument.Dispose()
   at Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser.ParseStream(Stream )
   at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load(Stream )
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean )
   --- End of inner exception stack trace ---
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.HandleException(ExceptionDispatchInfo )
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean )
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load()
   at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 )
   at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
   at GICutscenes.Program.ReadSetting() in /home/runner/work/GI-cutscenes/GI-cutscenes/src/Program.cs:line 239
   at GICutscenes.Program.<>c.<Main>b__1_0(FileInfo file, String key1, String key2, DirectoryInfo output, String engine, Boolean merge, Boolean subs, Boolean noCleanup, String audioFormat, String videoFormat) in /home/runner/work/GI-cutscenes/GI-cutscenes/src/Program.cs:line 168
   at System.CommandLine.Handler.<>c__DisplayClass10_0`10.<SetHandler>b__0(InvocationContext )
   at System.CommandLine.Invocation.AnonymousCommandHandler.<>c__DisplayClass2_0.<.ctor>g__Handle|0(InvocationContext )
   at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext )
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass18_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass13_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass20_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__19_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__6_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass9_0.<<UseExceptionHandler>b__0>d.MoveNext()

southrop avatar Apr 12 '23 15:04 southrop

I guess it's because the .NET version changed or something? I wish that was mentioned on the releases page. I tried installing .NET 7.0 manually from here but it didn't change anything, but using the standalone build works

southrop avatar Apr 12 '23 15:04 southrop

I reverted it back to .NET 6 due to some issues (#86) with the non-standalone builds (and I didn't have the time to investigate further), I forgot to change back the build instruction in the README section. How does your appsettings.json look like ?

ToaHartor avatar Apr 15 '23 13:04 ToaHartor

I was using the appsettings.json from the zip file, so it included the SubsStyle key. I also tried using a the reset command, but it only deleted the value for the subs folder key and didn't fix the issue.

{
  "Settings": {
    "MkvMergePath": "",
    "FfmpegPath": "",
    "SubsFolder": "./GenshinData/Subtitle",
    "SubsStyle": "Style: Default,{fontname},12,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100.0,100.0,0.0,0.0,1,0,0.5,2,10,10,14,1"
  }
}

southrop avatar Apr 15 '23 13:04 southrop

Got this error too, with .NET SDK 8.0.0-rc2 installed in my system. Seems like the current workaround is to always use the standalone version if you have different .NET version installed. Though I suggest removing the non-standalone package as .NET SDK 8 will be finalized as next LTS version in a few days in fear Windows might update to that and breaking the app

bagusnl avatar Nov 08 '23 12:11 bagusnl

Is it possible that since this tool uses .NET 6.0 it might not work with only 8.0 installed ? Since the non-standalone version uses the runtime installed on the computer, maybe it causes some parts of the program to malfunction 🤔 I may also consider upgrading the .NET version in the future.

ToaHartor avatar Nov 10 '23 14:11 ToaHartor

I do have .NET 6 runtime, .NET 7 SDK, and .NET 8 SDK all installed in my system, but it seems that it uses the latest version instead when running the non-standalone one image

bagusnl avatar Nov 10 '23 14:11 bagusnl

Hmm I wonder if it's possible to force within the app to use a specific SDK. Though, I'm pretty sure it has something to do with the JSON library used. Try running dotnet new globaljson --sdk-version 6.0.24 --force for instance, apparently it forces the execution of dotnet apps with the mentioned sdk 🤔

ToaHartor avatar Nov 10 '23 14:11 ToaHartor

Does not work unfortunately

Though, confusingly, even without global.json file it seems to tries to run it with NETCore 6.0.24 still but got an error with it. Here's attached WinDBG log

CommandLine: C:\Users\bagusnl_reg\Downloads\Compressed\GICutscenes-0.5.0-win-x64\GICutscenes.exe demuxUsm "E:\GameData\HoYoverse\GenshinImpact\Genshin Impact Game2\Gensh
Starting directory: C:\Users\bagusnl_reg\Downloads\Compressed\GICutscenes-0.5.0-win-x64

************* Path validation summary **************
Response                         Time (ms)     Location
Deferred                                       SRV*F:\Cache\symbols*http://msdl.microsoft.com/download/symbols*https://symbols.nuget.org/download/symbols
Symbol search path is: SRV*F:\Cache\symbols*http://msdl.microsoft.com/download/symbols*https://symbols.nuget.org/download/symbols
Executable search path is: 
ModLoad: 00007ff6`92b10000 00007ff6`92b39000   apphost.exe
ModLoad: 00007ffe`3c910000 00007ffe`3cb27000   ntdll.dll
ModLoad: 00007ffe`3bb50000 00007ffe`3bc14000   C:\Windows\System32\KERNEL32.DLL
ModLoad: 00007ffe`3a2c0000 00007ffe`3a667000   C:\Windows\System32\KERNELBASE.dll
ModLoad: 00007ffe`3a980000 00007ffe`3ab2e000   C:\Windows\System32\USER32.dll
ModLoad: 00007ffe`39f10000 00007ffe`39f36000   C:\Windows\System32\win32u.dll
ModLoad: 00007ffe`3b8e0000 00007ffe`3b909000   C:\Windows\System32\GDI32.dll
ModLoad: 00007ffe`39f40000 00007ffe`3a059000   C:\Windows\System32\gdi32full.dll
ModLoad: 00007ffe`39c90000 00007ffe`39d2a000   C:\Windows\System32\msvcp_win.dll
ModLoad: 00007ffe`39d30000 00007ffe`39e41000   C:\Windows\System32\ucrtbase.dll
ModLoad: 00007ffe`3ac20000 00007ffe`3b479000   C:\Windows\System32\SHELL32.dll
ModLoad: 00007ffe`3c0a0000 00007ffe`3c150000   C:\Windows\System32\ADVAPI32.dll
ModLoad: 00007ffe`3b480000 00007ffe`3b527000   C:\Windows\System32\msvcrt.dll
ModLoad: 00007ffe`3baa0000 00007ffe`3bb46000   C:\Windows\System32\sechost.dll
ModLoad: 00007ffe`3c470000 00007ffe`3c587000   C:\Windows\System32\RPCRT4.dll
(3335c.32a40): Break instruction exception - code 80000003 (first chance)
ntdll!LdrInitShimEngineDynamic+0x344:
00007ffe`3c9eb784 cc              int     3
0:000> g
ModLoad: 00007ffe`3a810000 00007ffe`3a841000   C:\Windows\System32\IMM32.DLL
ModLoad: 00007ffd`c7e90000 00007ffd`c7ee9000   C:\Program Files\dotnet\host\fxr\8.0.0-rc.2.23479.6\hostfxr.dll
ModLoad: 00007ffd`c7d20000 00007ffd`c7d84000   C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.24\hostpolicy.dll
ModLoad: 00007ffd`821e0000 00007ffd`826de000   C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.24\coreclr.dll
ModLoad: 00007ffe`3a670000 00007ffe`3a810000   C:\Windows\System32\ole32.dll
ModLoad: 00007ffe`3b550000 00007ffe`3b8d9000   C:\Windows\System32\combase.dll
ModLoad: 00007ffe`3b9c0000 00007ffe`3ba97000   C:\Windows\System32\OLEAUT32.dll
ModLoad: 00007ffe`3a240000 00007ffe`3a2ba000   C:\Windows\System32\bcryptPrimitives.dll
(3335c.32a40): Unknown exception - code 04242420 (first chance)
Profiler was prevented from loading notification profiler due to app settings.
  Process ID (decimal): 209756.  Message ID: [0x2509].
ModLoad: 00007ffd`817b0000 00007ffd`821d5000   C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.24\System.Private.CoreLib.dll
ModLoad: 00007ffd`c5150000 00007ffd`c52b2000   C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.24\clrjit.dll
ModLoad: 00007ffe`38c30000 00007ffe`38c48000   C:\Windows\SYSTEM32\kernel.appcore.dll
ModLoad: 000001c4`b68b0000 000001c4`b68be000   C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.24\System.Runtime.dll
ModLoad: 00007ffd`c7e50000 00007ffd`c7e8c000   C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.24\System.Collections.Concurrent.dll
ModLoad: 00007ffe`2a690000 00007ffe`2a695000   C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.24\System.ComponentModel.dll
ModLoad: 00007ffd`c6c30000 00007ffd`c6cb3000   C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.24\System.Linq.dll
ModLoad: 00007ffd`c7ce0000 00007ffd`c7d1e000   C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.24\System.Private.Uri.dll
ModLoad: 00007ffd`c7050000 00007ffd`c7090000   C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.24\System.Collections.dll
ModLoad: 00007ffd`c6750000 00007ffd`c679e000   C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.24\System.Runtime.Serialization.Formatters.dll
ModLoad: 00007ffd`da560000 00007ffd`da586000   C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.24\System.Console.dll
ModLoad: 00007ffd`c7020000 00007ffd`c704a000   C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.24\System.Memory.dll
ModLoad: 00007ffe`26e60000 00007ffe`26e66000   C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.24\System.Runtime.CompilerServices.Unsafe.dll
(3335c.32a40): C++ EH exception - code e06d7363 (first chance)
(3335c.32a40): C++ EH exception - code e06d7363 (first chance)
(3335c.32a40): C++ EH exception - code e06d7363 (first chance)
(3335c.32a40): C++ EH exception - code e06d7363 (first chance)
(3335c.32a40): C++ EH exception - code e06d7363 (first chance)
(3335c.32a40): CLR exception - code e0434352 (first chance)
ModLoad: 00007ffd`f4f90000 00007ffd`f5200000   C:\Windows\SYSTEM32\icu.dll
(3335c.32a40): CLR exception - code e0434352 (first chance)
(3335c.32a40): CLR exception - code e0434352 (first chance)
(3335c.32a40): CLR exception - code e0434352 (first chance)
(3335c.32a40): CLR exception - code e0434352 (first chance)
(3335c.32a40): CLR exception - code e0434352 (first chance)
(3335c.32a40): CLR exception - code e0434352 (first chance)
(3335c.32a40): CLR exception - code e0434352 (first chance)
(3335c.32a40): CLR exception - code e0434352 (first chance)
(3335c.32a40): CLR exception - code e0434352 (first chance)
(3335c.32a40): CLR exception - code e0434352 (first chance)
ModLoad: 00007ffd`efa00000 00007ffd`efa13000   C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.24\System.Threading.dll
ModLoad: 000001c4`b68f0000 000001c4`b68f8000   C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.24\System.Text.Encoding.Extensions.dll
ntdll!NtTerminateProcess+0x14:
00007ffe`3c9af8f4 c3              ret

bagusnl avatar Nov 10 '23 14:11 bagusnl

Alright, seems like it had a compilation problem (managed to get another error related to some libraries), maybe due to a conflict between the CI (which somehow stayed in .NET 7.0) and the program (which specifies .NET 6.0), and since some libraries were close to their 7.0 version, it might be breaking. So it should require an SDK upgrade and I'll try to stabilize everything on .NET 8.0.

I'll remove the non-standalone versions for now.

ToaHartor avatar Nov 10 '23 15:11 ToaHartor