0

I have created a project using C# on .NET Frame Work 4.0 and I used WIA (Windows Image Acquisition) and it was work successfully.
When I run the .exe file on another PC but I got a message saying:

System.BadImageFormatException was unhandled Message=Could not load file or assembly 'Interop.WIA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

even I had installed the WIA.dll successfully on that PC.

*Note:*I have created the project on windows 7 and the .exe was attempted to run on windows XP and other functionality works fine.

SenthilPrabhu
  • 661
  • 6
  • 29
Eng.LeLe
  • 1
  • 2
  • Are both machines the same bitness, e.g., both 32-bit or both 64 bit? – Philipp Schmid Apr 04 '12 at 17:35
  • you can use try to use the fusion log to see what's being loaded: http://msdn.microsoft.com/en-us/library/e74a18c4(vs.71).aspx . But that BadImageFormatException smells like wrong bitness to me. – Pedro Apr 04 '12 at 17:42
  • can you explain more Pedro how is it wrong to you??? – Eng.LeLe Apr 04 '12 at 17:54
  • I'm not sure what you mean... with the information you gave I'm not sure what it might be. That's why I pointed to a way of obtaining more information of what's happening... – Pedro Apr 04 '12 at 17:59
  • WIA is a Windows component. Resist all temptations to "install the WIA.dll", that does nothing but completely foobar the machine. – Hans Passant Apr 04 '12 at 18:12

1 Answers1

0

This normally happens when you have not enabled 32-bit applications for your Application Pool in IIS

To configure IIS to run 32-bit applications you must follow these steps:

Open IIS.
Go to the current server – > Application Pools.
Select the application pool your 32-bit application will run under.
Click the Advanced setting or Application Pool Default.
Set Enable 32-bit Applications to True.

Hope it helps