Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
My application threw System.IO.FileNotFoundException,Could not load file or assembly,
I pasted the dll to the app folder with same version and the I got badImageFormatException.
How do i solve this problem.

What I have tried:

I pasted dll to the app folder and execute the program again but then I got this error System.BadImageFormatException
Posted
Updated 31-Jan-17 16:01pm
v3

1 solution

Set the project's target to x86.
 
Share this answer
 
Comments
[no name] 31-Jan-17 12:48pm    
It's a running job in current server and it works fine. We need to move the app in New server, so we don't want to recompile or make any change in source file. Is it possible to change the app to target x86 without re compiling ?
Richard Deeming 31-Jan-17 14:59pm    
Use the CorFlags[^] tool:
corflags YourProject.exe /32BIT+
[no name] 31-Jan-17 15:57pm    
Thank you. I learned something today.

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