Search code examples
c#.netvb.netfreeimagetarget-platform

How to use FreeImage.NET in a x64 targeting project (AnyCpu)?


I'm trying to use the FreeImage .NET wrapper in my project, my ptoject targets AnyCPU and the dll wrapper will not work under this, it will only works if I target x86 machine.

When I try to load a file using the wrapper targeting AnyCPU or X64 it throws this exception:

"Se ha intentado cargar un programa con un formato incorrecto. (Excepción de HRESULT: 0x8007000B)" 

Translated:
"Intent to load a program with incorrect format (Excepción de HRESULT: 0x8007000B)"

I've tried to follow the steps to work with x64 freeimage in a net project: http://www.sambeauvois.be/blog/2010/05/freeimage-and-x64-projects-yes-you-can/

...But my VS2012 can't open any of the solutions, it says "can't find localized resources".

The source of freeimage and the wrapper is here: http://downloads.sourceforge.net/freeimage/FreeImage3154.zip

I need the dll converted to work with anycpu targeting, or a other solution to make it work, I'm working with VBNET.


Solution

  • You need to compile the freeimage library AND the .NET-wrapper to 64 bit.

    http://www.sambeauvois.be/blog/2010/05/freeimage-and-x64-projects-yes-you-can/