Click here to Skip to main content
15,896,497 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I downgraded .netFramework version from 4.5 to 4.0 in my Console project , It's not able to load assembly.

Throwing exception:

System.BadImageFormatException : Could not load file or assembly.

Assembly is third party and do work with .Net Framework 2.0
Posted
Comments
Sergey Alexandrovich Kryukov 7-Mar-15 8:57am    
What do you mean by that? I would assume you target some assembly to v.4.0, but then you would probably tell us that you decompiled and then recompiled 3rd-party assembly. You need to tell us what have you done in your project and how.
You should not mix up different things, such as .NET version to which each of the assemblies is targeted, .NET installed on one or some target computers, and so on.
—SA
Atmir 7-Mar-15 12:14pm    
Change CPU target to 32BIT and try

1 solution

If you are working on Win8.1, install .Net Framework 3.5 (which includes .Net 2.0 and 3.0).
4.0 is an integral part of 4.5, so you do not need to "downgrade" to 4.0.
See also How to Enable .NET Framework 2.0 and 3.5 in Windows 8.1 for Older Programs[^]
Cheers
Andi
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 1-Apr-15 12:22pm    
Sure, a 5.
—SA
Andreas Gieriet 1-Apr-15 16:11pm    
Thanks for your 5, Sergey!
Cheers
Andi

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