Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Newtonsoft.Json version mismatch on headless #33

Closed
zkxs opened this issue Apr 23, 2022 · 6 comments · Fixed by #35
Closed

Newtonsoft.Json version mismatch on headless #33

zkxs opened this issue Apr 23, 2022 · 6 comments · Fixed by #35
Labels
bug Something isn't working

Comments

@zkxs
Copy link
Collaborator

zkxs commented Apr 23, 2022

This is presumably being caused by the Neos headless server shipping with a different Newtonsoft.Json version

Discord thread: https://discord.com/channels/901126079857692714/96729959321999772

On NML 1.9.1 and 1.9.0:

Exception getting types from assembly NeosModLoader, Version=2022.4.23.366, Culture=neutral, PublicKeyToken=null:
System.Reflection.ReflectionTypeLoadException: 要求された型のうち 1 つまたは複数を読み込めませんでした。詳細については、LoaderExceptions プロパティを 取得してください。
   場所 System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   場所 System.Reflection.Assembly.GetTypes()
   場所 FrooxEngine.EngineInitializer.InitializeFrooxEngine(Engine engine) 場所 C:\Sync\Projects\Software\Applications\NeoS\NeosFramework\FrooxEngine\Initialization\EngineInitializer.cs:行 48

   at void FrooxEngine.EngineInitializer.InitializeFrooxEngine(Engine engine) in C:/Sync/Projects/Software/Applications/NeoS/NeosFramework/FrooxEngine/Initialization/EngineInitializer.cs:line 48
   at async Task FrooxEngine.Engine.Initialize(string appPath, string dataPath, string cachePath, ISystemInfo systemInfo, IInternalResource resources, bool verboseInit) in C:/Sync/Projects/Software/Applications/NeoS/NeosFramework/FrooxEngine/Engine.cs:line 717
   at void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start<TStateMachine>(ref TStateMachine stateMachine)
   at Task FrooxEngine.Engine.Initialize(string appPath, string dataPath, string cachePath, ISystemInfo systemInfo, IInternalResource resources, bool verboseInit)
   at async Task FrooxEngine.StandaloneFrooxEngineRunner.Initialize(string dataPath, string cachePath, bool verbose) in C:/Sync/Projects/Software/Applications/NeoS/NeosFramework/FrooxEngine/Engine/StandaloneFrooxEngineRunner.cs:line 54
   at void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start<TStateMachine>(ref TStateMachine stateMachine)
   at Task FrooxEngine.StandaloneFrooxEngineRunner.Initialize(string dataPath, string cachePath, bool verbose)
   at async Task NeosHeadless.Program.Main(string[] args) in C:/Sync/Projects/Software/Applications/NeoS/NeosFramework/NeosHeadless/Program.cs:line 177
   at void System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start<TStateMachine>(ref TStateMachine stateMachine)
   at Task NeosHeadless.Program.Main(string[] args)
   at void NeosHeadless.Program.<Main>(?)
        Reading settings file
...
User Spawn Userspace. Username: kaz0617, UserID: , MachineID: 89fdnqqpje-znlq4mjupag
Exception loading types from assembly: NeosModLoader, Version=2022.4.23.366, Culture=neutral, PublicKeyToken=null

   at List<AttributeMethod<A, D>> BaseX.ReflectionExtensions.FindAllStaticMethodsWithAttribute<A, D>(Predicate<Assembly> assemblyFilter)
   at void FrooxEngine.WorldPresets+<>c+<<GetPresets>b__13_0>d.MoveNext() in C:/Sync/Projects/Software/Applications/NeoS/NeosFramework/FrooxEngine/Userspace/WorldPresets/Scratchspace.cs:line 54
   at void System.Runtime.CompilerServices.AsyncTaskMethodBuilder<TResult>.Start<TStateMachine>(ref TStateMachine stateMachine)
   at Task<IEnumerable<WorldPreset>> FrooxEngine.WorldPresets.GetPresets()+() => { }
   at bool System.Threading.ThreadPoolWorkQueue.Dispatch()
SessionID set to S-7b1f7717-5c91-4668-83f7-fdf5b1cfe4dc. LastModifyingUser:
...
@zkxs zkxs added the bug Something isn't working label Apr 23, 2022
@ljoonal
Copy link
Member

ljoonal commented Apr 23, 2022

Weird. That error message doesn't seem to mention Json, but I guess the types thing does suggest a mismatch. Though my first guess would've been harmony versions...

Anyways, either someone with a headless needs to create a PR for this, or comment the version that's in use on the headless branch I imagine.

@kazu0617
Copy link
Contributor

Actually, in 1.8.0 get an error for only Json, but after this, throw an another error.
v1.8.0

[ERROR][NeosModLoader] Exception in execution hook!
System.IO.FileLoadException: ファイルまたはアセンブリ 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=null'、またはその依存関係の 1 つが読み込めませんでした。見つかったアセンブリのマニフェスト定義はアセンブリ参照に一致しません。 (HRESULT からの例外:0x80131040)
ファイル名 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=null' です。'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=null'
   場所 NeosModLoader.DebugInfo.Log()
   場所 NeosModLoader.ExecutionHook..cctor()

警告: アセンブリ バインドのログ記録がオフにされています。
アセンブリ バインドのエラー ログを有効にするには、レジストリ値 [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) を 1 に設定してください。
注意: アセンブリ バインドのエラー ログに関連するパフォーマンス ペナルティがあります。
この機能をオフにするには、レジストリ値 [HKLM\Software\Microsoft\Fusion!EnableLog] を削除します。

@kazu0617
Copy link
Contributor

Weird. That error message doesn't seem to mention Json, but I guess the types thing does suggest a mismatch. Though my first guess would've been harmony versions...

Anyways, either someone with a headless needs to create a PR for this, or comment the version that's in use on the headless branch I imagine.

yeah, I'll create an headless branch later.

@zkxs
Copy link
Collaborator Author

zkxs commented Apr 23, 2022

After poking around, it appears that the headless is using Newtonsoft.Json 13.0.1.25517, while the normal install is using 11.0.1.0. I'm guessing there are binary incompatibilities between the two of them.

@zkxs
Copy link
Collaborator Author

zkxs commented Apr 23, 2022

Also, this might be a compelling reason to switch to System.Text.Json... I didn't think Froox would have different dependency versions in headless vs the normal client, but here we are.

@zkxs
Copy link
Collaborator Author

zkxs commented Apr 24, 2022

@kazu0617 This should be fixed now with the NeosModLoaderHeadless.dll in the 1.10.0 release. I don't have a headless handy to test on, so please reopen this issue if it's still broken for you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants