Author Topic: when I use the twainlib give me this error, dont find the scanner  (Read 173 times)

gonzalocimma

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
In my proyect, give me this error

when tray to select default scanner

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

but when open your proyect, they find the scanner, what is wrong
I include the twainlib in the reference, visual studio 2015, windows 7 and windows 10
why in your proyect is ok, and the my not, I use the same code and form1

I think the difference is the cpu this class work with 32bits, and have 64bits I select all cpu, but mark prefer 32bits
« Last Edit: March 23, 2017, 12:26:38 AM by gonzalocimma »

mkaatr

  • Administrator
  • Full Member
  • *****
  • Posts: 115
  • Karma: +1/-0
    • View Profile
Re: when I use the twainlib give me this error, dont find the scanner
« Reply #1 on: March 29, 2017, 06:29:30 PM »
Hi there...

Sorry for the late reply. This error means that the DLLs needed for scanning are not included with your exe. Just make sure that the DLL files that you reference are part of the project output, i.e. the compiler put them with the executable. This should solve your issue.

yours sincerely.