Q: How do I resolve 'BadImageFormatException' when using 64-bit
version of PDFNet for .NET in Visual Studio Web Server?
I get the following error:
[BadImageFormatException: Could not load file or assembly 'PDFNet' or
one of its dependencies. An attempt was made to load a program with an
incorrect format.]
I am using 64-bit version of 64-bit machine, so why do I get this
error?
---------------
A: The problem may be related to Visual Studio Web Server which is by
default 32-bit - even on 64-bit systems.
From '64-bit read me.txt':
"If you are running a 64-bit version of this sample project, it must
be run on 64-bit web server or an error will be generated. Visual
Studio's development web server is only available in 32-bit, so visual
studio must be configured to use a 64-bit version of IIS, or
alternatively, a 64-bit version of CassiniDev. CassiniDev is "a fully
compatible drop-in replacement for the Visual Studio 2008/2010
development server". CassiniDev is available from
http://cassinidev.codeplex.com/
Alternatively, the 32-bit version of PDFNet can be used for
development."