Sunday, October 11, 2009 4:04 PM HosamKamel

[Resolved] Could not load file or assembly 'XXXXX' or one of its dependencies. An attempt was made to load a program with an incorrect format.

I have recently switched my development environment from 32-bit to 64-bit by installing Windows Server 2008 64-bit and modify it to be used as workstation as described here http://www.win2008workstation.com/ and I'm really amazed with it’s performance.

I have faced the problem mentioned in the post title when I'm trying to run a web application included in one of our development solutions.

couldnot load

I have checked the project which has the DBHelper as it’s output and I’ve discovered that the project configured to target x86 platform and as I'm working with 64-bit it will have such ‘incorrect format’ error.

How to fix it:

Simply follow the steps below :

  • open project properties window.
  • select Build tab
  • Change it to ‘Any CPU’
  • Save your changes.
  • Compile your project and run :)

image

Filed under: , ,

Comments

# Twitter Trackbacks for [Resolved] Could not load file or assembly 'XXXXX' or one of its dependencies. An attempt was made to load a [asp.net] on Topsy.com

Pingback from  Twitter Trackbacks for                 [Resolved] Could not load file or assembly 'XXXXX' or one of its dependencies. An attempt was made to load a         [asp.net]        on Topsy.com

# re: [Resolved] Could not load file or assembly 'XXXXX' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Sunday, October 18, 2009 6:45 AM by Gopalakrishnan

Hi,

I have a web site project (VS 2008) that has the build configuration set to Any CPU but still getting the same error for an assembly. Any other steps to solve this?

Thanks,

Gopalakrishnan

# re: [Resolved] Could not load file or assembly 'XXXXX' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Sunday, October 18, 2009 7:48 AM by HosamKamel

Hello Gopalakrishnan,

please make sure you have did so for all dependencies your website uses.

You can also enable 32-bit mode on IIS and adjust your website and its dependencies to target 86x platform.

let me know if this doesn't work for you.

Leave a Comment

(required) 
(required) 
(optional)
(required)