2

Please read question, it will not be duplicate.

I have a dll of intel perceptual computing. They have provided demo console application which is using the dll and working fine.

I tried to use same dll in a windows application. As soon as I create object of class it is throwing error :

Could not load file or assembly 'libpxcclr, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Whats issue here I could not figure out. I am running this on x64 bit machine.

Thanks for help.

Jens Björnhager
  • 5,632
  • 3
  • 27
  • 47
sunder
  • 1,803
  • 4
  • 29
  • 50
  • 2
    At this point I see no reasons for your statement: "it will not be duplicate" - I dont see proof that you verified that bitness of all DLL matches, checked if all DLLs are available (as specified by whoever provided you sample), check if rebuild thigs properly... – Alexei Levenkov Feb 15 '13 at 05:26
  • hey alexei...here the dll works great with console app. Why its throwing error in winforms and xna templete. – sunder Feb 15 '13 at 05:36
  • Its provided by intel. Dll works fine with console apps. If I create new template of winforms, xna or any else and as soon as i start creating object of a class it starts throwing this error. – sunder Feb 15 '13 at 05:38

1 Answers1

2

Not an answer but will not fit in comments...

  • you need to verify bitness of all DLL involved. You only specified bitness of your machine and it have nearly zero impact on bitness of the process and DLL. You need to check each DLL if it requires particular bitness (x86/x64) of the process.
  • you need to obtain list of DLL that are required and locations where they must be places (GAC, relative to process, in some special folder...). Normally whoever provides libraries/samples will have list of DLLs with location OR have setup program that configures all DLLs in correct places.
  • you need to make sure all files are in places they supposed to be (i.e. DLLs may need to be marked as "copy local", native binaries explicitly copied during build to approapriate places...). Often rebuild will clear up files places by hand - try to make all copy operation part of the build.

In worst case use tools like "depends" and "process explorer" to dig into dependencies...

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179
  • but here my dll is x64 bit and compliled with active cpu configuration. My machine is 64bit. Anyhow thanks for your reply. I will try to follow up with all points. – sunder Feb 15 '13 at 05:50
  • intel had give setup for their framework and i believe all dlls will be placed properly by it. I explicitly check program files folder. All looks fine. – sunder Feb 15 '13 at 06:00