PicNet / XGBoost.Net

.Net wrappers for the awesome XGBoost library
51 stars 18 forks source link

Bad Image Format? #17

Open DonWM opened 6 years ago

DonWM commented 6 years ago

Any clue as to what is happening?

I have a form project which accesses Xgboost but when I try to load Xgboost to create XGBRegressor, I get this.

I'm using 4.7.1 .NET for the form project and therefore had to upgrade the Xgboost project to 4.7.1. I'm not using the Nuget version. I added the Xgboost project as another project in my solution and updated it to 4.7.1 .net.

Inner Exception 1: BadImageFormatException: Could not load file or assembly 'XGBoost, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

ezracode commented 6 years ago

I have the same problem. I added the reference from NuGet.

jcapellman commented 6 years ago

Also getting this on .NET Core 2.0 at runtime - seems like libxgboost.dll is the problem. Need to have it dynamically load the macos/linux/win32 dll on runtime.

DonWM commented 6 years ago

I solved this by explicitly compiling for x64 rather than Any or x86

jcapellman commented 6 years ago

Thanks for the suggestion - with .NET Core 2 I tried every variation to no avail.