NeighTools / UnityDoorstop

Doorstop -- run C# before Unity does!
GNU Lesser General Public License v2.1
454 stars 69 forks source link

Not loading mono.dll IL2Cpp on Windows 2019? #20

Closed ersan closed 2 years ago

ersan commented 2 years ago

I have no idea if it's Doorstop or the mono runtime that comes with BepInEx that's the issue, but after building the verbose version of Doorstop 3 I get this when trying to run an IL2Cpp game (V Rising) on Windows 2019:

Doorstop started!
EXE Path: C:\vrserver\VRisingServer.exe
App dir: C:\vrserver
Working dir: C:\vrserver
STDOUT handle at 0000000000000060
Pointer to GetFinalPathNameByHandleA 00007FF9BBDB2560
STDOUT handle path: 
DLL Path: C:\vrserver\WINHTTP.dll
Doorstop DLL Name: WINHTTP
Looking for original DLL from C:\vrserver\WINHTTP_alt.dll
Looking for original DLL from C:\Windows\system32\WINHTTP.dll
Proxy loaded
CONFIG: UnityDoorstop.enabled = true
CONFIG: UnityDoorstop.ignoreDisableSwitch = false
CONFIG: UnityDoorstop.redirectOutputLog = false
CONFIG: UnityDoorstop.targetAssembly = BepInEx\core\BepInEx.IL2CPP.dll
CONFIG: UnityDoorstop.dllSearchPathOverride = 
CONFIG: MonoBackend.runtimeLib = mono\MonoBleedingEdge\EmbedRuntime\mono-2.0-sgen.dll
CONFIG: MonoBackend.configDir = mono\MonoBleedingEdge\etc
CONFIG: MonoBackend.corlibDir = mono\Managed
CONFIG: MonoBackend.debugEnabled = false
CONFIG: MonoBackend.debugSuspend = false
CONFIG: MonoBackend.debugAddress = 127.0.0.1:10000
Config loaded
Doorstop enabled!
Installing IAT hook
Hook installed!!
Got il2cpp_init at 00007FF8BD4A0000
Loaded all runtime functions
Starting IL2CPP domain "IL2CPP Root Domain"
Mono lib: C:\vrserver\mono\MonoBleedingEdge\EmbedRuntime\mono-2.0-sgen.dll
Mono mscorlib dir: C:\vrserver\mono\Managed
Mono confgi dir: C:\vrserver\mono\MonoBleedingEdge\etc
Loaded mono.dll: 0000000000000000
Failed to load mono.dll! Skipping!

But on Windows 10 and 11 using the exact same files I get this and it works fine:

Loaded mono.dll: 00007FF874560000
Loaded mono.dll functions
ersan commented 2 years ago

I figured it out, if anyone runs into this it's because Windows 2019 doesn't include Visual C++ 2015 Redistributable - you can get it here: https://www.microsoft.com/en-us/download/details.aspx?id=52685