Home › Forums › Software Development › [Solved] BadImageFormatException:
- This topic has 20 replies, 3 voices, and was last updated 7 years, 1 month ago by Grant [Tobii].
- AuthorPosts
- 15/06/2017 at 10:25 #7039DeviParticipant
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 #7048Grant [Tobii]KeymasterHi @devi,
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\x64Hopefully 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 #7060DeviParticipantHello,
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
Thanks
18/06/2017 at 21:50 #7061Grant [Tobii]KeymasterHi @devi, sorry the image was not sent.. can you send a link to imgur instead? thanks
21/06/2017 at 10:05 #7074DeviParticipantHi @Grant[Tobii]
21/06/2017 at 10:06 #707522/06/2017 at 00:05 #7078Grant [Tobii]KeymasterHi @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 #7080Grant [Tobii]KeymasterI 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良治ParticipantI 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.You wrote:
>>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\x64The nuget package include the following folder tree:
Interaction –
build
x64
Tobii.EyeX.Client.dll
lib
net45
Tobii.Interaction.Model.dll
Tobii.Interaction.Net.dllThere are no \lib\x64\*.dll. Where can I get x64 version of Tobii.interaction.*.dll?
07/08/2017 at 11:10 #7246Grant [Tobii]KeymasterHi @ysato,
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良治ParticipantTobii dll works when “Any CPU” && “Prefer 32-bit” was enabled,
but it doesn’t when 64 bit config is selected.I tried
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 #7253Grant [Tobii]KeymasterHi @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良治ParticipantI 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 #7256Grant [Tobii]KeymasterHi @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良治ParticipantI 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.15If 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. - AuthorPosts
- You must be logged in to reply to this topic.