c++ - Why installing vcredist_x86.exe doesn't fix SideBySide error when I develop an EXE on one machine and run it on another one? -
c++ - Why installing vcredist_x86.exe doesn't fix SideBySide error when I develop an EXE on one machine and run it on another one? -
issue
i wrote c++ project called 'foo' using microsoft visual studio 2005 verison 8.0.50727.762 (sp.050727-7600) on windows xp professional version 2002 service pack 3. built project foo.exe. then, copied file foo.exe windows server 2003 enterprise edition service pack 2. when tried run it, failed error,
c:\foo.exe application has failed start because application configuration incorrect. reinstalling application may prepare problem.
in event viewer > system, 3 events logged.
event id: 32; source: sidebyside
dependent assembly microsoft.vc80.crt not found , lastly error referenced assembly not installed on system.
event id: 59; source: sidebyside
resolve partial assembly failed microsoft.vc80.crt. reference error message: referenced assembly not installed on system.
event id: 59; source: sidebyside
generate activation context failed c:\foo\foo.exe. reference error message: referenced assembly not installed on system.
installing microsoft visual c++ 2005 redistributable didn't prepare it
downloaded vcredist_x86.exe http://www.microsoft.com/download/en/details.aspx?id=3387 installed it. installer created folder calledc:\windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
. the version of software found 'add or remove programs' '8.0.50727.42'.
on trying run c:\foo\foo.exe, got same errors described above.
installing microsoft visual c++ 2005 sp1 redistributable didn't prepare it
downloaded vcredist_x86.exe http://www.microsoft.com/download/en/details.aspx?id=5638 installed it. installer created folder called:c:\windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700
. the version of software found 'add or remove programs' '8.0.56336'.
on trying run c:\foo\foo.exe, got same errors described above.
copying crt dlls , manifest same machine (where i'm running exe) didn't prepare it.
i copiedmsvcm80.dll
, msvcp80.dll
, msvcr80.dll
c:\windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
c:\foo
. next, copied c:\windows\winsxs\manifests\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd.manifest
c:\foo
, renamed microsoft.vc80.crt.manifest
. the 4th line of manifest file looked this:
<assemblyidentity type="win32" name="microsoft.vc80.crt" version="8.0.50727.42" processorarchitecture="x86" publickeytoken="1fc8b3b9a1e18e3b"></assemblyidentity>
when tried running c:\foo\foo.exe time, didn't work. repeated thing 1 time again dlls in c:\windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700
, corresponding manifest file. didn't help well. got same error.
in both cases, got next errors in event viewer > system.
event id: 34; source: sidebyside
component identity found in manifest not match identity of component requested
event id: 58; source: sidebyside
syntax error in manifest or policy file "c:\foo\microsoft.vc80.crt.manifest" on line 4.
event id: 59; source: sidebyside
generate activation context failed c:\foo\foo.exe. reference error message: manifest file contains 1 or more syntax errors.
copying crt dlls , manifest windows xp machine (where built exe) didn't prepare it.
i copiedmsvcm80.dll
, msvcp80.dll
, msvcr80.dll
c:\winnt\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700
of windows xp machine (where developed , built foo.exe) c:\foo
of windows server 2003 (where trying run foo.exe). next, copied c:\winnt\winsxs\manifests\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700.manifest
c:\foo
, renamed microsoft.vc80.crt.manifest
. the 4th line of manifest file looked this:
<assemblyidentity type="win32" name="microsoft.vc80.crt" version="8.0.50727.762" processorarchitecture="x86" publickeytoken="1fc8b3b9a1e18e3b"></assemblyidentity>
on trying run c:\foo\foo.exe got same errors mentioned in previous section.
copying crt dlls , manifest visual studio folder fixed it.
copiedmsvcm80.dll
, msvcp80.dll
, msvcr80.dll
, microsoft.vc80.crt.manifest
c:\program files\microsoft visual studio 8\vc\redist\x86\microsoft.vc80.crt
of windows xp machine (where developed , built foo.exe) c:\foo
of windows server 2003 machine (where trying run it). the 4th line of manifest file looked this:
<assemblyidentity type="win32" name="microsoft.vc80.crt" version="8.0.50727.6195" processorarchitecture="x86" publickeytoken="1fc8b3b9a1e18e3b"></assemblyidentity>
this time run c:\foo\foo.exe without issues.
question
i expecting installing 'microsoft visual c++ 2005 sp1 redistributable' (vcredist_x86.exe) described in sec approach prepare it. didn't. copying dlls , manifest files c:\program files\microsoft visual studio 8\vc\redist\x86\microsoft.vc80.crt
folder of development machine fixed it. why so?
build options
in case, helps reply question. here compiler , linker options picked visual studio project properties:
configuration properties > c/c++ > command line:
/o2 /gl /d "_mbcs" /fd /ehsc /md /fo"release\\" /fd"release\vc80.pdb" /w3 /nologo /c /wp64 /zi /tp /errorreport:prompt
configuration properties > linker > command line:
/out:"c:\mixedbag\release\foo.exe" /nologo /manifest /manifestfile:"release\foo.exe.intermediate.manifest" /debug /pdb:"c:\mixedbag\release\foo.pdb" /opt:ref /opt:icf /ltcg /machine:x86 /errorreport:prompt kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
i'll reply own question. comments question hans passant , luke helped.
i downloaded microsoft visual c++ 2005 service pack 1 redistributable bundle mfc security update , installed on scheme trying run c:\foo\foo.exe
. exe ran fine after this.
the installer placed crt dlls in c:\windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262b86
. so, yes, 8.0.50727.6195 version of crt dlls looking hans passant rightly said.
the easiest way figure version looking @ manifest file generated visual studio while building project on development system. mine located @ c:\foo\release\foo.exe.intermediate.manifest
. had tag this:
<assemblyidentity type='win32' name='microsoft.vc80.crt' version='8.0.50727.6195' processorarchitecture='x86' publickeytoken='1fc8b3b9a1e18e3b' />
so, clue needed 8.0.50727.6195 version of dlls. rest matter of searching right vcredist_x86.exe happened in url have mentioned in sec paragraph. page in url contains link kb2538242 shows version numbers of dlls installed installer.
note: elie has mentioned in a different answer question, since 32-bit application, necessary install vcredist_x86.exe (not vcredist_x64.exe) on scheme application supposed run irrespective of whether scheme 32-bit windows scheme or 64-bit windows system. 1 time again, .manifest file provides clue in processorarchitecture
attribute.
c++ visual-c++ side-by-side
Comments
Post a Comment