0

I am creating a web page using ASP.Net C# 4.0, that will be used to detect scanner deployed with a server and save scanned images to the server. I have created this page using WIA (Windows Image Acquisition). This page is working and scanning images when I run it within asp.net development server, but when I deploy it in IIS 6.0 it says:

Could not load file or assembly 'Interop.WIA' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Is it because of WIA being a COM component ? Or is there anything which I am missing when deployed in IIS ? Please help !!!

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
shrekDeep
  • 2,260
  • 7
  • 27
  • 39

2 Answers2

0

"An attempt was made to load a program with an incorrect format." Usually means you're trying to load 32-bit code into a 64-bit process or vice-versa.

Try setting your IIS app pool to 32-bit (some info here)

Iain Ballard
  • 4,433
  • 34
  • 39
0

Got to Start->Run->type inetmgr and on the left application pools, select DefaultAppPool and the virtual directory name of the app and for both make sure to enable 32 -bit applications to true, am using IIS7.0 and windows 7 64-bit.

Solution