Click here to Skip to main content
15,923,689 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Could not load file or assembly 'TwainDotNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d3cd6e1539fa8c71' or one of its dependencies. An attempt was made to load a program with an incorrect format.


What I have tried:

i am also set my Set my project to x86 to use TwainDotNet.

i don't know what to do now... :(
Posted
Updated 16-Nov-18 20:04pm

Hi Ketan,
I had the same error when a dependant dll file I copied had zero bytes. Use File Explorer to check the size of any dll's that your program needs and make sure they are not zero bytes in size.
Cheers
 
Share this answer
 
Comments
ketan Ram Patil 8-Nov-17 5:19am    
Thank you For your valuable replay. i am also checked in the file explorer dll size is not empty.
:(
You must do these steps
1-Project> yourproje PROPERTIES
2-Left Menu> Build tabs
3- Checked "Prefer 32-Bit"
Finish.
 
Share this answer
 
Comments
Richard Deeming 16-Nov-18 9:38am    
The OP already said that they've set the project to x86.
ruyet7247 16-Nov-18 14:24pm    
I say;
I don't want it to be set to X86
1-Project> yourproje PROPERTIES
2-Left Menu> Build tabs
3- "Prefer 32-Bit" checked (click here)
NOT: Platform target= AnyCPU (platform will be anycpu)


Richard Deeming 16-Nov-18 14:26pm    
"32-bit" and "x86" are the same thing. 🤦‍♂️
ruyet7247 16-Nov-18 14:28pm    
I know, but the system works this way.
Richard Deeming 16-Nov-18 14:30pm    
What part of "The OP has already set their project to x86" was unclear?

You've posted a new solution to a question from last year simply to tell the OP to do something they've already done!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900