Home › Forums › Software Development › [Solved] BadImageFormatException
- This topic is empty.
- AuthorPosts
- 25/05/2017 at 21:37 #6944BlairParticipant
I am attempting my first program using the Tobii .NET API. I followed the directions in the developer’s guide for adding references. (copied the EyeXFramework project into my project folder and added as existing project, copied Tobii.EyeX.Client.dll into my project folder and changed the properties, added references to EyeXFramework.dll and Tobii.EyeX.Client.Net20.dll, selected x64 before running) My program recognizes the EyeXHost object. It runs fine with the line “private EyeXHost eyeXHost;” The samples also run without exception.
When I try to run the line “eyeXHost = new EyeXHost();” in my program I get the exception “BadImageFormatException: Could not load file or assembly ‘EyeXFramework, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. An attempt was made to load a program with an incorrect format.”
The only information I could find about this error said it is caused by a mismatch in the bit type. I recopied in the DLLs from the x64 folder and tried running my program as x86 but neither worked. Please let me know if anything else can cause this error.
26/05/2017 at 15:51 #6957Grant [Tobii]KeymasterHi @blair, I believe this is still a problem with the DLL’s not having the right bitness. Did you by chance know about the tutorial we have written for getting started available @
http://developer.tobii.com/walkthrough-setting-cc-project-eyex-c-api/
Although the arhitecture is different, I still think following this guide would be good way to ensure the proper procedure is followed. Please get back to us if you still have problems.
26/05/2017 at 16:47 #6959BlairParticipantIt turned out the issue was the “Prefer 32-Bit” setting in project properties.
28/05/2017 at 16:08 #6961Grant [Tobii]KeymasterHi @blair, cool thanks for getting back to us and letting us know the origin of the problem .. Happy coding!
- AuthorPosts
- You must be logged in to reply to this topic.