DanielHazzard / Cure-Please

Final Fantasy XI Healing Bot - (Uses EliteAPI) - Community Maintained
http://www.elitemmonetwork.com/forums/viewtopic.php?f=11&t=509
GNU General Public License v2.0
34 stars 35 forks source link

Unable to load DLL 'EliteAPI.dll' #108

Open KevinKozan opened 4 years ago

KevinKozan commented 4 years ago

Another one of these types of issues. I've tried:

.NET runtimes are:

2.0.50727.4927 Service Pack 2
3.0.30729.4926 Service Pack 2
3.5.30729.4926 Service Pack 1
4.0.0.0
4.8.03752

I attached a debugger to view the code and it's just a hard instatiation problem on EliteAPI. The debugger can't actually step into the constructor for EliteAPI, nor is the error message particularly useful. Worth noting Project properties in VS had target framework at .NET Framework 4.5, so I don't think it's a .NET version issue.

I ommited the rest of the trace past the CurePlease form, it's not particularly useful to the actual exception being thrown.

System.DllNotFoundException
  HResult=0x80131524
  Message=Unable to load DLL 'EliteAPI.dll': A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A)
  Source=EliteMMO.API
  StackTrace:
   at EliteMMO.API.EliteAPI.CreateInstance(Int32 processId)
   at EliteMMO.API.EliteAPI..ctor(Int32 processId)
   at CurePlease.Form1.setinstance_Click(Object sender, EventArgs e) in F:\FFXI\Dualbox Stuff\Cure-Please-2.0.4.3\Form1.cs:line 3018
DanielHazzard commented 4 years ago

Always confirm you have the required C++ Redists needed.

VC++ 2010 x86 http://download.microsoft.com/download/5/B/C/5BC5DBB3-652D-4DCE-B14A-475AB85EEF6E/vcredist_x86.exe

VC++ 2012 x86 http://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU3/vcredist_x86.exe

VC++ 2013 x86 http://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x86.exe

VC++ 2015 x86 https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x86.exe

This is 99% the problem when errors occur, please let me know if you have reinstalled them and the problem still occurs.

KevinKozan commented 4 years ago

Uninstalled, downloaded the linked Redists, still getting Unable to load DLL 'EliteAPI.dll': A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A)

Is there a way to easily discern what dependencies a dll is missing when you try to instantiate it? I tried using dependency walkers but it seems kind of all over the place.

DanielHazzard commented 4 years ago

Are you editing from source if so you need to put both EliteAPI DLLs in the Debug/Release folder?

EliteAPI.dll EliteMMO.API.dll

As CurePlease is not set to do so automatically.

KevinKozan commented 4 years ago

Can confirm that I placed it in both debug + release folders, loaded assembly points to the right path:

EliteMMO.API
    Assembly Version: 1.3.0.0
    Win32 Version: 1.3.0.0
    CodeBase: file:///<path_to_clone>/Cure-Please-2.0.4.3/obj/x86/Debug/EliteMMO.API.DLL

I also noticed all of the othe rloaded assemblies are .NET 4.8 based like below. I don't imagine that has much to do with it though


    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4001.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll```