neos-modding-group / NeosModLoader

A mod loader for Neos VR
GNU Lesser General Public License v3.0
61 stars 22 forks source link

Neos Mod Loader not starting correctly on Windows Headless Host/Client #53

Closed Wolfscopez closed 2 years ago

Wolfscopez commented 2 years ago

Came across this issue a few weeks ago but never got around to lodging it as an issue on the GitHub.

Logs indicate that the Headless Client is partly able to start the mod loader but some internal fault is not allowing it to get any further?

If needed I can elaborate further or copy my messages from the Discord Help & Support tab in the server.

XDelta commented 2 years ago

Can you post logs and possibly link to the messages you had in discord? (Or copy over the relevant bits here)

Wolfscopez commented 2 years ago

https://discord.com/channels/901126079857692714/901129369832026213/992686243597008977 https://discord.com/channels/901126079857692714/901129369832026213/992692274712559626 https://discord.com/channels/901126079857692714/901129369832026213/992698773312634900 https://discord.com/channels/901126079857692714/901129369832026213/992708631894163516 https://discord.com/channels/901126079857692714/901129369832026213/992801590505390130

KAIS-SERVER_-2022.1.28.1335-_2022-07-03_02_29_31.log

Here's a few links to the messages on the Neos Modding Discord Server as well as the latest log which I had.

zkxs commented 2 years ago

I don't know what's going wrong here. What even is this issue? Why does it only affect Windows Headless? It's not a Headless issue, as Linux Headless works. It's not a Windows issue, as Windows Headed works.

My thoughts:

XDelta commented 2 years ago

To add on a little bit, I have not been able to get a windows headless to load any mods either, and can atleast confirm that the unblock checkbox wasn't the issue.

zkxs commented 2 years ago

An exciting new log from SectOLT

[INFO] [NeosModLoader] D:\steamcmd\steamapps\common\NeosVR\HeadlessClient\Libraries\NeosModLoader.config is missing! This is probably fine.
[INFO] [NeosModLoader] loading assemblies from nml_libs
[INFO] [NeosModLoader] Loaded libraries from nml_libs:
0Harmony, Version=2.2.1.0, Culture=neutral, PublicKeyToken=null Sha256=FD5F3E54C0B49ACF7B0816BADA32EA55A83ED06280A71A103C52E07F207D74EB
[ERROR][NeosModLoader] Exception in execution hook!
System.IO.FileNotFoundException: Could not load file or assembly '0Harmony, Version=2.2.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: '0Harmony, Version=2.2.1.0, Culture=neutral, PublicKeyToken=null'
   at NeosModLoader.DebugInfo.Log()
   at NeosModLoader.ExecutionHook..cctor()

=== Pre-bind state information ===
LOG: DisplayName = 0Harmony, Version=2.2.1.0, Culture=neutral, PublicKeyToken=null
 (Fully-specified)
LOG: Appbase = file:///D:/steamcmd/steamapps/common/NeosVR/HeadlessClient/
LOG: Initial PrivatePath = NULL
Calling assembly : NeosModLoader, Version=1.12.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: D:\steamcmd\steamapps\common\NeosVR\HeadlessClient\Neos.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///D:/steamcmd/steamapps/common/NeosVR/HeadlessClient/0Harmony.DLL.
LOG: Attempting download of new URL file:///D:/steamcmd/steamapps/common/NeosVR/HeadlessClient/0Harmony/0Harmony.DLL.
LOG: Attempting download of new URL file:///D:/steamcmd/steamapps/common/NeosVR/HeadlessClient/0Harmony.EXE.
LOG: Attempting download of new URL file:///D:/steamcmd/steamapps/common/NeosVR/HeadlessClient/0Harmony/0Harmony.EXE.
LOG: Attempting download of new URL file:///D:/steamcmd/steamapps/common/NeosVR/HeadlessClient/Libraries/0Harmony.DLL.
LOG: Attempting download of new URL file:///D:/steamcmd/steamapps/common/NeosVR/HeadlessClient/Libraries/0Harmony/0Harmony.DLL.
LOG: Attempting download of new URL file:///D:/steamcmd/steamapps/common/NeosVR/HeadlessClient/Libraries/0Harmony.EXE.
LOG: Attempting download of new URL file:///D:/steamcmd/steamapps/common/NeosVR/HeadlessClient/Libraries/0Harmony/0Harmony.EXE.

Windows Neos Headless is able to load Harmony from the base directory and it works fine. It's just somehow subtly failing to hook into assemblies loaded via Assembly.LoadFile(string). This is problematic, because the assemblies in nml_mods have the same issue, and we can't put those into the base directory.

New thoughts on what might be causing this: Assembly.LoadFile does something weird (Froox is using Assembly.LoadFrom for plugins)

Changing NML to used LoadFrom appears to have fixed it. No idea why. And why this only affected Windows Headless is a mystery. I suspect that Neos.exe.config might be the culprit.

zkxs commented 2 years ago

This fix is now released in NML 1.12.1.