Click here to Skip to main content
15,879,326 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am stuck in the following exception.

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

This is a desktop application and it was working fine for last few months. Recently I have upgraded my PC to a 64 bit one, and since then I am getting this exception. Can someone help me to fix this?

Thanks for your time....

Regards
Sebastian
Posted
Comments
sjelen 27-Feb-13 7:01am    
The assembly you're referencing was probably compiled only for x86 (not for x64 or 'Any CPU').
You can either try to find x64 version of assembly, or you can compile your application explicitly for x86 (in VS: Project properties -> Build tab -> Platform target)
Sebastian T Xavier 27-Feb-13 7:04am    
In that case, will the application work in a 64 bit machine? I think no.

1 solution

Hi,
You are building some of the projects in x64 and some in either x86 or Any CPU inside one solution.

Right click on the Solution, Select the Configuration manager from the context menu. Set all projects target platform to x86and re build again.

Regards
Jegan
 
Share this answer
 
Comments
Sebastian T Xavier 27-Feb-13 7:12am    
It is set to "Any CPU" already.
Jegan Thiyagesan 27-Feb-13 7:20am    
Have you made sure that all the projects involved are set to the same target and have you clean the binaries before rebuild?
Sebastian T Xavier 27-Feb-13 7:35am    
yes
Jegan Thiyagesan 27-Feb-13 7:44am    
Then you are using a dll that is build for x64. you need to check all your references target platform are correct.

Have you tried with changing the target to x86?

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