Items with no label
3335 Discussions

BadImageFormatException, when trying to run C# project - Intel realsense SDK

JOzol
Beginner
2,222 Views

Every time i try to compile i'm getting this error:

  1. System.BadImageFormatException: 'An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)'

when i try to run session = PXCMSession.CreateInstance();

I'm running Windows 10 pro, 32 bit operating system.

Added reference to file:

c:\Program Files\Intel\RSSDK\bin\win32\libpxcclr.cs.dll

added to post build evenent:

if "$(Platform)" == "x86" ( copy /y "$(RSSDK_DIR)\bin\win32\libpxccpp2c.dll" "$(TargetDir)" ) else ( copy /y "$(RSSDK_DIR)\bin\x64\libpxccpp2c.dll" "$(TargetDir)" )

And in build tab changed platform target from Any CPU to X86

0 Kudos
3 Replies
MartyG
Honored Contributor III
419 Views

Edit: originally this was a post titled 'BadImageFormatException, when trying to run C# project' but later got mysteriously replaced with the title 'Bn' and only containing the message 'n'

Are you using the '2016 R3' SDK? R3 has a very different structure to the previous SDKs and uses a library file with a different name - libpxccore_c.dll - and totally different folder location. So if you are using R3, your program may be looking for a library file reference that no longer exists in that SDK.

idata
Employee
419 Views

Hi zaholk,

 

 

I've fixed the title and the content of the tread so that the original message is displayed. Go ahead and try the suggestion posted by @MartyG and let us know your results. We'll be waiting for your response.

 

 

@MartyG-Thank for helping out!

 

 

Regards,

 

-Sergio A

 

0 Kudos
idata
Employee
419 Views

Hi zaholk,

 

 

Do you still need assistance with this thread? Let us know your results of trying @MartyG's suggestion.

 

 

-Sergio A

 

0 Kudos
Reply