usrbincat / BmmLLaunchPatch

BepInEx 6 Patcher to get the itch.io version of "Bury Me, My Love" to launch
MIT License
3 stars 0 forks source link

Unhandled exception running patch #1

Open erictbar opened 2 years ago

erictbar commented 2 years ago

I tried running your patch after installing the game from the itch.io launcher and am unable to get it to work.

Note that I decided to run the APK version of the game in WSA and can play the game (in other words, no rush), but perhaps others are having the same issue?

Unhandled exception
System.IO.FileNotFoundException: Could not load file or assembly 'BepInEx.Core, Version=6.0.0.530, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'BepInEx.Core, Version=6.0.0.530, Culture=neutral, PublicKeyToken=null'
   at BepInEx.NetLauncher.NetPreloaderRunner.OuterMain(String[] args, String filename)
   at BepInEx.NetLauncher.Program.Main(String[] args)

=== Pre-bind state information ===
LOG: DisplayName = BepInEx.Core, Version=6.0.0.530, Culture=neutral, PublicKeyToken=null
 (Fully-specified)
LOG: Appbase = file:///H:/itch/bury-me-my-love 2/
LOG: Initial PrivatePath = NULL
Calling assembly : BepInEx.NetLauncher, Version=6.0.0.530, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\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:///H:/itch/bury-me-my-love 2/BepInEx.Core.DLL.
LOG: Attempting download of new URL file:///H:/itch/bury-me-my-love 2/BepInEx.Core/BepInEx.Core.DLL.
LOG: Attempting download of new URL file:///H:/itch/bury-me-my-love 2/BepInEx.Core.EXE.
LOG: Attempting download of new URL file:///H:/itch/bury-me-my-love 2/BepInEx.Core/BepInEx.Core.EXE.

Press enter to exit...

[process exited with code 4294967295]

H:\ is my Internal HDD Reinstalled the game which is why it now is bury-me-my-love 2

Windows 11 Pro 21H2 22000.469 AMD Ryzen 7 5800X

usrbincat commented 2 years ago

Hmm, that's strange. Sorry it didn't work for you.

My best guess is that this problem is related to running the game on Windows 11, since I haven't tested it with that. I have tested running the game on non-C: drives on Windows 10, and that worked for me.

Are you able to temporarily transfer the bury-me-my-love 2 folder to your C: drive and run it from there? What happens when you do that?

What happens if you copy H:\itch\bury-me-my-love 2\BepInEx\core\BepInEx.Core.dll to H:\itch\bury-me-my-love 2\BepInEx.Core.dll and then try to run the game? Do you get the same error message?

I'll try to make an updated version of the mod, with a newer version of BepInEx NetLauncher. I don't know if that will fix the issue, but it's worth a shot.

erictbar commented 2 years ago

I have tried both of those, and neither worked.

I have completed one ending in the game using WSA, though it was a pain as it kept freezing (though the game saved every time luckily). I would love to replay it using Windows if this can be fixed. Again, no rush, though.

usrbincat commented 2 years ago

Ah, unfortunate. That's good to know though. Do you get a similar error about System.IO.FileNotFoundException: Could not load file or assembly 'BepInEx.Core, [...] ?

erictbar commented 2 years ago

Actually now the error is different, possibly after adding BepInEx.Core.dll to the main folder.

Unhandled exception
System.IO.FileNotFoundException: Could not load file or assembly 'MonoMod.Utils, Version=21.12.13.1, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'MonoMod.Utils, Version=21.12.13.1, Culture=neutral, PublicKeyToken=null'
   at BepInEx.Paths.SetExecutablePath(String executablePath, String bepinRootPath, String managedPath, String[] dllSearchPath)
   at BepInEx.NetLauncher.NetPreloaderRunner.OuterMain(String[] args, String filename)
   at BepInEx.NetLauncher.Program.Main(String[] args)

=== Pre-bind state information ===
LOG: DisplayName = MonoMod.Utils, Version=21.12.13.1, Culture=neutral, PublicKeyToken=null
 (Fully-specified)
LOG: Appbase = file:///D:/itch/bury-me-my-love 2/
LOG: Initial PrivatePath = NULL
Calling assembly : BepInEx.Core, Version=6.0.0.530, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\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:/itch/bury-me-my-love 2/MonoMod.Utils.DLL.
LOG: Attempting download of new URL file:///D:/itch/bury-me-my-love 2/MonoMod.Utils/MonoMod.Utils.DLL.
LOG: Attempting download of new URL file:///D:/itch/bury-me-my-love 2/MonoMod.Utils.EXE.
LOG: Attempting download of new URL file:///D:/itch/bury-me-my-love 2/MonoMod.Utils/MonoMod.Utils.EXE.

Press enter to exit...

[process exited with code 4294967295]

Copied MonoMods.Utils.dll to D:/itch/bury-me-my-love 2/ (H has been replaced with D, I have formatted my SSD due to other issues while leaving the internal HDD mostly intact) and then same with SemanticVersioning.dll and it doesn't seem like there is any end.

usrbincat commented 2 years ago

Ooh, that's very interesting! What happens if you copy everything from D:\itch\bury-me-my-love 2\BepInEx\core to D:\itch\bury-me-my-love 2\ ?

erictbar commented 2 years ago

Different error this time: [Message: Preloader] Preloader started [Fatal : Preloader] Unhandled exception [Fatal : Preloader] System.IO.FileLoadException: Could not load file or assembly 'file:///D:\itch\bury-me-my-love 2\BepInEx\patchers\BMMLLaunchPatch.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) File name: 'file:///D:\itch\bury-me-my-love 2\BepInEx\patchers\BMMLLaunchPatch.dll' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information. at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark) at System.Reflection.Assembly.LoadFrom(String assemblyFile) at BepInEx.Preloader.Core.Patching.AssemblyPatcher.AddPatchersFromDirectory(String directory) at BepInEx.NetLauncher.NetPreloader.Start(String[] args) at BepInEx.NetLauncher.NetPreloaderRunner.PreloaderMain(String[] args)

I have enabled sandboxing in itch.io launcher in the past but it isn't right now, though this appears to be a sandbox with .NET.

Daniel-Mendes commented 2 years ago

Hey, to work for me I had to install Visual Studio, build the game with dotnet build and copy files to the game folder.

AppData\Roaming\itch\apps\bury-me-my-love image

AppData\Roaming\itch\apps\bury-me-my-love\BepInEx\core image

AppData\Roaming\itch\apps\bury-me-my-love\BepInEx\patchers image

Errors remaining image

usrbincat commented 2 years ago

Interesting, are you also on Windows 11? Does the game work despite the errors?

Daniel-Mendes commented 2 years ago

Yes I'am on on Windows 11. The game lauches but I didn't played the full game. Just opened it.

Is there parameters for dotnet build to compile for 64-bit ?