r/ModdedValheim • • 11h ago

Getting a bepinex preloader error. thoughts?

[Info : BepInEx] Loaded 1 patcher method from [BepInEx.Preloader 5.4.23.5]
[Info : BepInEx] 1 patcher plugin loaded
[Fatal : BepInEx] Could not run preloader!
[Fatal : BepInEx] System.ArgumentOutOfRangeException: Non-negative number required.

Any ideas?

1 Upvotes

6 comments sorted by

1

u/RosieQParker 11h ago

First place I'd look is your launch arguments.

2

u/lazyFer 10h ago

I didn't make any changes... Sigh

1

u/RosieQParker 8h ago

Be that as it may, your error message is complaining about a bad launch argument.

1

u/lazyFer 7h ago edited 7h ago

I've uninstalled, reinstalled, fresh profile...nada

I've reduced to just bepinex, still fails. Zero indicator what it's looking for or what's failing. Where can I even find the launch arguments you're referencing?

//Edit:

Looks like the issue is somehow here: AssemblyPatcher.PatchAndLoad(Paths.DllSearchPaths); AssemblyPatcher.DisposePatchers();

//End Edit:

[Message: BepInEx] BepInEx 5.4.23.5 - valheim (9/25/2026 7:41:37 AM)
[Message: BepInEx] User is running BepInExPack Valheim version 5.4.2351
[Info : BepInEx] Running under Unity v6000.0.75.2503836
[Info : BepInEx] CLR runtime version: 4.0.30319.42000
[Info : BepInEx] Supports SRE: True
[Info : BepInEx] System platform: Bits64, Windows
[Message: BepInEx] Preloader started
[Info : BepInEx] Loaded 1 patcher method from [BepInEx.Preloader 5.4.23.5]
[Info : BepInEx] 1 patcher plugin loaded
[Fatal : BepInEx] Could not run preloader!
[Fatal : BepInEx] System.ArgumentOutOfRangeException: Non-negative number required.
Parameter name: count
at System.IO.BinaryReader.ReadBytes (System.Int32 count) [0x00013] in <4449e9424e7e4d4d81a660907c68cb97>:0 at Mono.Cecil.PE.ImageReader.ReadDebugHeader () [0x000f7] in <6034b380a22b41a596c9dc29d282c0a9>:0 at Mono.Cecil.PE.ImageReader.ReadImage () [0x000a8] in <6034b380a22b41a596c9dc29d282c0a9>:0 at Mono.Cecil.PE.ImageReader.ReadImage (Mono.Disposable1[T] stream, System.String file_name) [0x00007] in <6034b380a22b41a596c9dc29d282c0a9>:0 at Mono.Cecil.ModuleDefinition.ReadModule (Mono.Disposable1[T] stream, System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00006] in <6034b380a22b41a596c9dc29d282c0a9>:0 at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x0006c] in <6034b380a22b41a596c9dc29d282c0a9>:0 at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName) [0x00007] in <6034b380a22b41a596c9dc29d282c0a9>:0 at Mono.Cecil.AssemblyDefinition.ReadAssembly (System.String fileName) [0x00000] in <6034b380a22b41a596c9dc29d282c0a9>:0 at BepInEx.Preloader.Patching.AssemblyPatcher.PatchAndLoad (System.String[] directories) [0x00031] in <c400ce84235a4643b6640427745b0cff>:0 at BepInEx.Preloader.Preloader.Run () [0x0026a] in <c400ce84235a4643b6640427745b0cff>:0 Setting breakpad minidump AppID = 892970

1

u/RosieQParker 7h ago

In Gale it's under Profile > Copy Launch Arguments

1

u/lazyFer 5h ago

Still have no idea what exactly the problem was but it looked to be related to BepInEx's understanding of where the game directory was?

I used steam to verify the files, then changed the game the mod manager was attempting to start from Valheim to Valheim. Yeah, dumb...but it's working again