Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load file or assembly exception

Any thoughts on what might be causing this exception?

I have a webservice proj, when i load the link i get

Could not load file or assembly 'Interop.DIB' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'Interop.DIB' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Inner exceptions:

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

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

[HttpException (0x80004005): Could not load file or assembly 'Interop.DIB' or one of its dependencies. An attempt was made to load a program with an incorrect format.]

Version Information:
Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

like image 421
Sharpeye500 Avatar asked Feb 23 '12 18:02

Sharpeye500


People also ask

Could not load file or assembly manifest definition does not match the assembly reference?

The located assembly's manifest definition does not match the assembly reference. As stated, this is caused when the version of a . dll file in the /bin directory (assembly reference), is not the same as specified in the web. config (assembly manifest).

How do you fix Could not load file or assembly or one of its dependencies?

There are some workarounds for this issue: The dll file may not be in /bin folder. Just copy the dll file to /bin folder or set this preference Copy Local = True from Visual Studio. If the problem persists, check if the version of the assembly that is referenced is different than the version it is looking for.

Could not load file or assembly culture neutral Publickeytoken null or one of its dependencies?

This error usually means that the assembly was not found. Try verifying that the file exists in the directory where your application is running.

Could not load file or assembly system Cannot find file specified?

For the alert error ("The system cannot find the file specified.") Right click on [Solution Program name] then select Build Dependencies> & left click on Build Customizations... then true-checkbox {MASM} then click OK button.


1 Answers

Ok the answer is Got to Start->Run->type inetmgr and on the left application pools, select DefaultAppPool and the virtual directory name of the app and for both make sure to enable 32 -bit applications to true, am using IIS7.0 and windows 7 64-bit. enter image description here

like image 90
Sharpeye500 Avatar answered Oct 01 '22 23:10

Sharpeye500