Home › Forums › Software Development › [Solved] BadImageFormatException:
- This topic has 20 replies, 3 voices, and was last updated 7 years, 3 months ago by Grant [Tobii].
- AuthorPosts
- 10/08/2017 at 14:00 #7259Grant [Tobii]Keymaster
Hi @ysato, could you please report the file size of Tobii.EyeX.Client.dll in each output folder?
64-bit version should be of size 1275kB, otherwise it is 849kB.
Please also confirm if the following lines appear in the .csproj-file:
<Import Project="..\..\packages\Tobii.Interaction.0.7.3\build\Tobii.Interaction.targets" Condition="Exists('..\..\packages\Tobii.Interaction.0.7.3\build\Tobii.Interaction.targets')" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> <Error Condition="!Exists('..\..\packages\Tobii.Interaction.0.7.3\build\Tobii.Interaction.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Tobii.Interaction.0.7.3\build\Tobii.Interaction.targets'))" /> </Target>
Can you also kindly try to rebuild the project from scratch to make sure the correct files are copied?12/08/2017 at 02:17 #7265良治Participant\packages\Tobii.Interaction.0.7.3\build\AnyCPU\Tobii.EyeX.Client.dll 849KB
\packages\Tobii.Interaction.0.7.3\build\x64\Tobii.EyeX.Client.dll 1,275KB
\packages\Tobii.Interaction.0.7.3\build\x86\Tobii.EyeX.Client.dll 849KBI find the following lines in my csproj file when AnyCPU config. Only one line for import section.
…
<Reference Include=”Tobii.Interaction.Model, Version=0.7.3.333, Culture=neutral, PublicKeyToken=70326046dcdce6cb, processorArchitecture=MSIL”>
<HintPath>..\packages\Tobii.Interaction.0.7.3\lib\net45\Tobii.Interaction.Model.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include=”Tobii.Interaction.Net, Version=0.7.3.333, Culture=neutral, PublicKeyToken=70326046dcdce6cb, processorArchitecture=MSIL”>
<HintPath>..\packages\Tobii.Interaction.0.7.3\lib\net45\Tobii.Interaction.Net.dll</HintPath>
<Private>True</Private>
</Reference>
…
<Import Project=”..\packages\Tobii.Interaction.0.7.3\build\Tobii.Interaction.targets” Condition=”Exists(‘..\packages\Tobii.Interaction.0.7.3\build\Tobii.Interaction.targets’)” />
…I will try today to rebuild my project from scratch as 64bit app from the beginning.
12/08/2017 at 04:24 #7266良治ParticipantI tried to create a new c# project with 64 target.
I added NuGet Tobii Interaction package before any additional modifications.
But the files under Tobii package are exactly the same a before.16/08/2017 at 14:45 #7292Grant [Tobii]KeymasterHi @ysato, apologies but we are having troubles here understanding why it is not working for you and we cannot reproduce the error here.
The .Net assemblies referenced in Tobii Core SDK (Tobii.Interaction.Net.dll and Tobii.Interaction.Model.dll) are compiled with an AnyCPU config, so they shouldn’t pose a problem.
Also, Tobii.EyeX.Client.dll is being correctly created and is different for each architecture. (as you can see the file size difference)
Maybe you can try to copy the correct native dll to the output folder? Was there a chance to test on another computer?
17/08/2017 at 04:56 #7296良治Participant>>you can try to copy the correct native dll to the output folder
I succeeded to run both Tobii sdk and other 64bit dll under 64 config app.
I checked projectfolfer/bin/debug/Tobii.EyeX.Client.dll. It was 32bit. I copied 64bit Tobii.EyeX.Client.dll to the folder.
Then my app run as 64 bit.
That must be a bug of Visual Studio 2015.Thanks for a long effort of your support.
17/08/2017 at 11:34 #7297Grant [Tobii]KeymasterHi @ysato, okay great! Glad to hear you got it working 🙂
- AuthorPosts
- You must be logged in to reply to this topic.