ApplicationProgramIn the event log:
"C: \ windows \ system32 \ test.exe" activation context generation failed. Subordinate assembly not found
Microsoft. vc80.mfc, processorarchitecture = "x86", publickeytoken = "1fc8b3b9a1e18e3b", type = "Win32", version = "8.0.50727.762 ".
Use sxstrace.exe for detailed diagnosis.
This type of problem occurs because the program file compiled by vc2005 adopts the manifest method to specify the DLL file. For WIN98 and win2000 systems
Put the DLL Connection Library together. WINXP and win2003 systems are much more troublesome. The VC Connection Library is stored in the winsxs directory by default.
Solution: Use vcredist_x86.exe to resend the program.
:( Http://download.microsoft.com/download/7/9/8/798325b7-8993-4ef9-9148-8db9ff4187fc/vcredist_x86.exe)
- For the solution, VS is set to debug and release. The key is that the manifest path is different during packaging.
- For deployed programs, VS has two sets of solutions, which share the parallel assembly and private assembly deployment methods. The former is actually dependent on things under the Windows \ winsxs directory of the target machine, the latter requires the program to come with it.
- During program compilation, it is mainly set in two places. The first is the MFC in the general configuration of the project, and the second is the code below C/C ++ in the project configuration.
In the Runtime Library settings in generation. If your program can be compiled after modification, you can.
When I was about to release the program written in vs2005 today, I copied it to my colleague's machine and double-click it. "The application failed to start due to incorrect configuration, re-installation of the application may correct this problem. "This problem has caused me a lot of surprises. I have only encountered a lack of DLL in the past, but this problem has made me unable to solve it for a moment. Think about it for two reasons, either because he didn't install vs2005, or because my program depends on other libraries. So Baidu found many related topics. I followed this post to solve the problem:
Programs written in C ++ in vs2005 are deployed on a system without vs2005 installed,
Run the command line with the following prompt:
"The system cannot execute the specified program"
Double-click to run the task. The following message is displayed:
"Because the application configuration is incorrect and the application cannot be started, re-installing the application may correct this problem"
If you used vc6 and vs2003 in the past, if the library file is missing, you will be prompted that the "**. dll" is missing, but this is not prompted when you use vs2005.
After experiment, I feel that the following solutions are feasible:
Method 1:
Similar to c: \ Program Files \ Microsoft Visual
Studio 8 \ Vc \ redi
The following files are found in ST \ debug_nonredist \ x86 \ microsoft. vc80.debugcrt:
Msvcm80d. dll
Msvcp80d. dll
Msvcr80d. dll
Microsoft. vc80.debugcrt. manifest
Copy these files to the target machine, and run them in the same folder as the running program or in system32.
All the other release versions and MFC programs can copy the files in the corresponding folder under redist, and the files are marked after the folder!
Method 2:
Modify the compilation option and change/MD or/MDD to/Mt or/MTD. In this way, the static link to the VC Runtime Library is implemented and the vc dll is no longer needed during the runtime.
Method 3:
Project-> properties-> Configuration properties-> General-> Use of MFC, select "use MFC in static library"
The generated EXE file can be run on other machines.
Method 4:
Find the vcredist_xxx.exe package on your vc8installation disk and then bind it with your program.