If the configuration of the target platform or activity platform fails to load the file, the Assembly "xxx", or one of its dependencies, an error is reported.
Today, when we dynamically load an assembly, we find that the Assembly already exists, the error "failed to Load file or assembly" xxx "or one of its Dependencies" is still reported. After the program and configuration errors are eliminated, the system may wonder whether the problem is caused by the environment, so after Baidu and msdn, I finally found the answer. Here I will record it to prevent other people from encountering it in the future.
If you generate an x86 instance instead of Any CPU, the following error will not occur in the 64-bit operating system.
The server error in the "/xxxxx" application.
--------------------------------------------------------------------------------
Failed to Load file or assembly "xxx" or one of its dependencies. Attackers try to load programs with incorrect format.
Note: An unhandled exception occurs during the execution of the current Web request. Check the stack trace information for details about the error and the source of the error in the code.
Exception details: System. BadImageFormatException: failed to load the file, assembly "xxx", or one of its dependencies. Attackers try to load programs with incorrect format.
Source error:
An unhandled exception is generated during the execution of the current Web request. You can use the following exception stack trace information to determine the cause and location of the exception.
Solution:
You can create an application as Any CPU.
Otherwise, if the system is 64-bit Win7, you should change the target platform generated for the new project to x86.
To sum up:
64-bit Win7 solution generation target platform is set to x86
32-bit OS solution generation target platform is set to AnyCPU
Reference from: http://blog.csdn.net/liuluyan/article/details/9249483
Http://msdn.microsoft.com/zh-cn/library/zekwfyz4 (VS.80). aspx
Publish the website. The file is not loaded, the Assembly "ChineseTokenizer", or one of its Dependencies tries to load a program in an incorrect format.
1. Failed to Load file or assembly "*" or one of its dependencies. Attackers try to load programs with incorrect format.
Cause: the operating system is 64-bit, but the released program references some 32-bit ddl, so there is a compatibility problem.
Solution 1: If it is a 64-bit machine, IIS -- application pool -- advanced settings -- enable 32-bit application: true.
Solution 2: Modify project properties-generate-Target Platform (for example, X86 \ X64)
[Extraordinary e-Family Network Studio] C # errors during debugging and running, prompt: file or assembly "xxx" or one of its Dependencies cannot be loaded
If your reference component is faulty, update your reference component, or you do not have this component at all.