Failed to load file or assembly "XXX" or one of its dependencies. An attempt was made to load an incorrectly formatted program. _ Practical Tips

Source: Internet
Author: User
Tags stack trace
A server error in the "/xxxxx" application.
--------------------------------------------------------------------------------
Failed to load file or assembly "xxx" or one of its dependencies. An attempt was made to load an incorrectly formatted program.
Note: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace for more information about the error and where the error occurred in the code.
Exception Details: system.badimageformatexception: Failed to load file or assembly "xxx" or one of its dependencies. An attempt was made to load an incorrectly formatted program.
SOURCE Error:
An unhandled exception was generated during the execution of the current WEB request. You can use the following exception stack trace to determine information about the cause of the exception and where it occurred.

Workaround:
It's okay to have an application as any CPU
Conversely, if the system is a 64-bit Win7, you should change the build target platform for the new project to x86


Comprehensive:
The build target platform for the 64-bit Win7 solution is set to x86
The build target platform for the 32-bit OS solution is set to AnyCPU

Another user's problem solving method:

I have encountered this problem two times, but the environment is different.

First time: Windows 2008 Server R2 64-bit;

Second time: Windows 7 64 bits;

Cause Analysis: The operating system is 64-bit, but the published program references some 32-bit DDL, so there is a compatibility issue.

Solution: iis--Application Pool-Advanced settings-enable 32-bit applications: true.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.