Home › Forums › Software Development › [Solved] BadImageFormatException:
- This topic has 20 replies, 3 voices, and was last updated 5 years, 7 months ago by Grant [Tobii].
- 15/06/2017 at 10:25 #7039
Hi I am new to the Tobii eyex development. I have created a windows form application which has two buttons. My object is to when look at the Particular button that should trigger the button click. But the problem is it is not executing the activated event from the EyeX Engine to trigger the click.
Also another issue is I am not able to run the Sample code ActivableButtonForms and it gives an like this: “BadImageFormatException: using An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)”. I am using Visual studio 2012 32bit
Please help me.15/06/2017 at 16:33 #7048
The BadImageFormatException when loading a dll is caused by incompatible bitness (32 or 64-bit) on the solution/project vs. the DLL.
To resolve the error, you can either:
– Change target platform to x86 in your Visual Studio solution
– If you want to build a 64-bit application, change the references for the two DLLs Tobii.EyeX.Client.dll and Tobii.EyeX.Client.Net20.dll to the 64-bit versions, located in \lib\x64
Hopefully once you get the Activatable Buttons sample going, it should clear up your remaining doubts.
Please let us know how you get on.18/06/2017 at 10:23 #7060
I have changed the target platform to x86, but I am getting the same error. I am attaching the screen shot of the configuration and the error
Thanks18/06/2017 at 21:50 #7061
Hi @devi, sorry the image was not sent.. can you send a link to imgur instead? thanks21/06/2017 at 10:05 #7074
21/06/2017 at 10:06 #707522/06/2017 at 00:05 #7078
Hi @devi, thanks for that.. can you please confirm the location of the Tobii.EyeX.Client.dll and Tobii.EyeX.Client.Net20.dll files on your system and that you have added this location to the path directory in the Visual Studio project? It seems from the error, that VS simply cannot find the DLL as needed.22/06/2017 at 16:35 #7080
I would also advise you to have a look over a tutorial we produced detailing the steps to get up and running on Visual Studio @ http://developer.tobii.com/walkthrough-setting-cc-project-eyex-c-api/07/08/2017 at 06:48 #7245
I use Tobii.Interaction v0.7.3 nuget package and trying to run Tobii API.
It runs well in a AnyCPU config, but it faces the BadImageFormatException problem in 64 app config which I need to build.
My app refers to two dlls – Tobii.Interaction.Model.dll and Tobii.Interaction.Net.dll.
>>to build a 64-bit application, change the references for the two DLLs Tobii.EyeX.Client.dll and Tobii.EyeX.Client.Net20.dll to the 64-bit versions, located in \lib\x64
The nuget package include the following folder tree:
There are no \lib\x64\*.dll. Where can I get x64 version of Tobii.interaction.*.dll?07/08/2017 at 11:10 #7246
Something quick to check is within the project properties for visual studio is if “Prefer 32-Bit” has been enabled?
And rerun nuget for the Tobii Interaction Package.08/08/2017 at 02:43 #7251
Tobii dll works when “Any CPU” && “Prefer 32-bit” was enabled,
but it doesn’t when 64 bit config is selected.
1) uninstall Tobii.Interaction package
2) set project config as 64 bit target.
2) install again Tobii.Interaction package.
But I find the same load error with BadImageFormatException message.
If Tobii.interaction NuGet package should support 64 bit, this looks a bug of package creation.08/08/2017 at 11:43 #7253
Hi @ysato, sorry to hear about your issues.
Were you able to at least successfully run the samples included with the Core SDK available @https://github.com/Tobii/CoreSDK
I was able to run both 32 and 64bit variants of these samples on my system without issue
using the Tobii Interaction Nuget Package.
What happens when you try it with for example the Interactions 101 sample?
I did have issues with Visual Studio 2017, and so use 2015.. maybe you can try that?09/08/2017 at 03:02 #7255
I experimented to run Interaction Interactors 101 sample in CoreSDK. I use VS 2015.
It runs with Any CPU + “Prefer 32-Bit”.
It neither run with “Any CPU + NOT prefer 32bit” nor “64bit target”. They show the same error “BadImageFormatException” at the line of “var host = new Host();”
VS 2015 configuration manager of Tobii SDK projects, even 64 bit does not show up in configuration choice menu.09/08/2017 at 17:32 #7256
Hi @ysato, It’s rather odd as I have the same setup as was able to get it working with little problem.
I wonder, can you build to 64bit a regular application (ie not using Tobii SDK?)
You could try uninstall NuGet Package, then change build conditions to 64bit, then install again “Tobii Interaction” package.
Out of curiosity, is there a chance you can try building on another system just to check?10/08/2017 at 00:14 #7257
I compared Tobii dlls between two configs:
– Nuget install for Project config 64bit
– NuGet install for project config Any CPU (32bit prefered)
However Dll files are the same between those two configs.
Tobii.Interaction.Model 0.7.3.333 95.5KB 2017/06/06 13:15
Tobii.InteractionNet 0.7.3.333 176KB 2017/06/16 13.15
If Nuget package should install different dlls, the file size must be different. (64 bit ones should be bigger).
I am developing a c# application which uses (1) Tobii package and (2) 64 bit dll which I build by myself (64bit OpenCV wrapper).
When I set app config 64bit, the Tobii dll load fails.
When I set app config Any CPU (32bit prefered), the 64bit dll load fails.
Current Tobii dlls must be for 32bit, and not support 64bit.
- You must be logged in to reply to this topic.