If you generate the application x86 instead of any CPU, there will be no error in the 64-bit operating system, and the following error resolution may occur on 32-bit operating systems
:
The application will be born as any CPU.
Conversely, if the system is a 64-bit Win7, the new project's build target platform should be changed to x86
Comprehensive:
The build target platform for the 64-bit Win7 solution is set to x86
The build target platform for 32-bit operating system 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 Server R2 64-bit;
Second time: Windows 7 64-bit;
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.
Failed to load file or assembly "XXX" or one of its dependencies. Trying to load a program that is not properly formatted