为什么在我在一台机器上开发EXE并在另一台机器上运行EXE时,安装vcredist_x86.exe无法修复SideBySide错误? [英] Why installing vcredist_x86.exe doesn't fix SideBySide error when I develop an EXE on one machine and run it on another one?

查看:1072
本文介绍了为什么在我在一台机器上开发EXE并在另一台机器上运行EXE时,安装vcredist_x86.exe无法修复SideBySide错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题



我使用Microsoft Visual Studio 2005 Verison 8.0.50727.762(SP.050727-7600)写了一个名为Foo的C ++项目)在Windows XP Professional版本2002 Service Pack 3.我建立的项目到Foo.exe。然后,我将文件Foo.exe复制到Windows Server 2003企业版Service Pack 2.当我试图运行它,它失败了这个错误,

  C:\foo.exe 
应用程序启动失败,因为应用程序配置不正确。
重新安装应用程序可能会解决问题。

在事件查看器>系统中,记录了三个事件。



事件ID:32;资料来源:SideBySide

 无法找到依赖的程序集Microsoft.VC80.CRT,最后的错误是
引用的程序集未安装在您的系统上。

事件ID:59;来源:SideBySide

 解决部分装配失败的Microsoft.VC80.CRT。 
引用错误消息:系统上未安装引用的程序集。

事件ID:59;来源:SideBySide

 生成C:\foo\Foo.exe的激活上下文失败。 
引用错误消息:系统上未安装引用的程序集。

安装Microsoft Visual C ++ 2005 Redistributable无法修复 >


  1. http://www.microsoft.com/download/en/details.aspx?id=3387

  2. 安装它。安装程序创建了一个名为 C:\windows\winsxs\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd 的文件夹。

从添加或删除程序找到的此软件的版本为8.0.50727.42。



在尝试运行C:\foo\foo.exe,我得到了与上述相同的错误。



安装Microsoft Visual C ++ 2005 SP1 Redistributable 't fix it


  1. http://www.microsoft.com/download/en/details.aspx?id=5638

  2. 已安装它。安装程序创建了一个名为 C:\windows\winsxs\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700 的文件夹。

从添加或删除程序找到的此软件的版本为8.0.56336。



在尝试运行C:\foo\foo.exe时,我遇到了与上述相同的错误。



复制CRT DLL和清单


  1. 我复制了 msvcm80.dll msvcp80.dll msvcr80.dll from
    C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
    C:\foo

  2. 接下来,我复制了
    C:\WINDOWS\WinSxS\Manifests\x86_Microsoft.VC80。 CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd.manifest
    C:\foo ,并将其重命名为 Microsoft .VC80.CRT.manifest

清单文件的第四行如下所示: p>

 < assemblyIdentity type =win32name =Microsoft.VC80.CRTversion =8.0.50727.42
processorArchitecture =x86
publicKeyToken =1fc8b3b9a1e18e3b>< / assemblyIdentity>

当我试图运行C:\foo\foo.exe这次,工作。我再次使用 C:\windows\winsxs\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700 中的DLL以及相应的清单文件重复了此操作。它没有帮助,以及。我有同样的错误。



在这两种情况下,我在事件查看器>系统中有以下错误。



事件ID:34;来源:SideBySide

 清单中找到的组件标识与请求的组件的标识不匹配

事件ID:58;来源:SideBySide

 清单或策略文件C:\foo\ Microsoft.VC80.CRT.MANIFEST 

事件ID:59;来源:SideBySide

 生成C:\foo\Foo.exe的激活上下文失败。参考错误消息:清单文件包含一个或多个语法错误。 

从Windows XP计算机(我在其中构建EXE)复制CRT DLL和清单


  1. 我复制了 msvcm80.dll msvcp80.dll msvcr80.dll
    C:\winnt\\ \\ winsxs \x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700 Windows XP机器(我开发和构建foo.exe)
    C:\\

  2. 接下来,我复制了
    \\ foo Windows Server 2003(我尝试运行foo.exe) C:\winnt\winsxs\Manifests\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700.manifest

    C:\foo ,并将其重命名为 Microsoft.VC80.CRT.manifest


$ b b

清单文件的第四行如下所示:

 < assemblyIdentity type =win32name = Microsoft.VC80.CRTversion =8.0.50727.762
processorArchitecture =x86
publicKeyToken =1fc8b3b9a1e18e3b>< / assemblyIdentity>

试图运行C:\foo\foo.exe现在我得到了相同的错误




从Visual Studio文件夹复制CRT DLL和清单已修复。 b


  1. 已复制 msvcm80.dll msvcp80.dll msvcr80.dll Microsoft.VC80.CRT.manifest C:\Program Files\Microsoft Visual Studio 8 \VC\redist\x86\Microsoft.VC80.CRT (其中我开发并构建foo.exe)到 C:\

第四行是Windows Server 2003计算机的第四行清单文件看起来像这样:

 < assemblyIdentity type =win32name =Microsoft.VC80.CRTversion = 8.0.50727.6195
processorArchitecture =x86
publicKeyToken =1fc8b3b9a1e18e3b>< / assemblyIdentity>

这次我可以运行C:\foo\foo.exe没有任何问题。 p>

问题



我希望安装Microsoft Visual C ++ 2005 SP1 Redistributable vcredist_x86.exe)如第二种方法中所述将修复它。但它没有。从 C:\Program Files\ Microsoft Visual Studio 8 \VC\redist\x86\Microsoft.VC80.CRT 文件夹复制DLL和清单文件的开发机固定它。为什么会这样?



构建选项



回答我的问题。这里是从Visual Studio项目属性中拾取的编译器和链接器选项:



配置属性> C / C ++>命令行:



/ O2 / GL / D_MBCS/ FD / EHsc / MD / FoRelease\\/Fd\"Release\vc80.pdb/ W3 / nologo / c / Wp64 / Zi / TP / errorReport:prompt



配置属性>链接器>命令行:



/ 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

解决方案

我会回答我自己的问题。



我下载了 Microsoft Visual C ++ 2005 Service Pack 1可再分发软件包MFC安全更新,并将其安装在我试图运行的系统上 C:\foo\\ \\ foo.exe 。此后EXE运行良好。



安装程序将CRT DLL放置在 C:\windows\winsxs\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8 .0.50727.6195_x-ww_44262b86 。所以,是的,8.0.50727.6195是CRT DLL的版本,我正在寻找Hans Passant正确地说。



这个版本的最简单的方法是看看在开发系统上构建我的项目时由Visual Studio生成的清单文件。 Mine位于 C:\Foo\Release\Foo.exe.intermediate.manifest 。它有这样的标签:

 < assemblyIdentity type ='win32'name ='Microsoft.VC80.CRT'version = '8.0.50727.6195'
processorArchitecture ='x86'
publicKeyToken ='1fc8b3b9a1e18e3b'/>

所以,这是一个线索,我需要8.0.50727.6195版本的DLL。其余的是搜索正确的vcredist_x86.exe的问题,恰巧在我在第二段中提到的URL。该网页中的网页包含指向 KB2538242 的链接,该链接显示了安装程序将安装的DLL的版本号。



注意:由于Elie在其他答案中提到这个问题,因为这是一个32位的应用程序,有必要在该应用程序应运行的系统上安装vcredist_x86.exe(不是vcredist_x64.exe),无论该系统是否为32位Windows系统或一个64位Windows系统。再次,.manifest文件在 processorArchitecture 属性中提供此线索。


Issue

I wrote a 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. I built the project into Foo.exe. Then, I copied the file Foo.exe to a Windows Server 2003 Enterprise Edition Service Pack 2. When I tried to run it, it failed with this error,

C:\foo.exe
The application has failed to start because the application configuration is incorrect.
Reinstalling the application may fix the problem.

In Event Viewer > System, three events were logged.

Event ID: 32; Source: SideBySide

Dependent Assembly Microsoft.VC80.CRT could not be found and Last Error was
The referenced assembly is not installed on your system.

Event ID: 59; Source: SideBySide

Resolve Partial Assembly failed for Microsoft.VC80.CRT.
Reference error message: The referenced assembly is not installed on your system.

Event ID: 59; Source: SideBySide

Generate Activation Context failed for C:\foo\Foo.exe.
Reference error message: The referenced assembly is not installed on your system.

Installing Microsoft Visual C++ 2005 Redistributable didn't fix it

  1. Downloaded vcredist_x86.exe from http://www.microsoft.com/download/en/details.aspx?id=3387
  2. Installed it. The installer created a folder called C:\windows\winsxs\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd.

The version of this software as found from 'Add or Remove Programs' was '8.0.50727.42'.

On trying to run C:\foo\foo.exe, I got the same errors I described above.

Installing Microsoft Visual C++ 2005 SP1 Redistributable didn't fix it

  1. Downloaded vcredist_x86.exe from http://www.microsoft.com/download/en/details.aspx?id=5638
  2. Installed it. The installer created a folder called: C:\windows\winsxs\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700.

The version of this software as found from 'Add or Remove Programs' was '8.0.56336'.

On trying to run C:\foo\foo.exe, I got the same errors I described above.

Copying CRT DLLs and manifest from the same machine (where I'm running the EXE) didn't fix it.

  1. I copied msvcm80.dll, msvcp80.dll and msvcr80.dll from C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd to C:\foo.
  2. Next, I copied C:\WINDOWS\WinSxS\Manifests\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd.manifest to C:\foo and renamed it to Microsoft.VC80.CRT.manifest.

The fourth line of the manifest file looked like this:

<assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.42"
                  processorArchitecture="x86"
                  publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>

When I tried running C:\foo\foo.exe this time, it didn't work. I repeated this thing again with the DLLs in C:\windows\winsxs\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700 and the corresponding manifest file. It didn't help as well. I got the same error.

In both cases, I got the following errors in Event Viewer > System.

Event ID: 34; Source: SideBySide

Component identity found in manifest does not match the identity of the 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 for C:\foo\Foo.exe. Reference error message: The manifest file contains one or more syntax errors.

Copying CRT DLLs and manifest from the Windows XP machine (where I built the EXE) didn't fix it.

  1. I copied msvcm80.dll, msvcp80.dll and msvcr80.dll from C:\winnt\winsxs\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700 of Windows XP machine (where I developed and built foo.exe) to C:\foo of Windows Server 2003 (where I am trying to run foo.exe).
  2. Next, I copied C:\winnt\winsxs\Manifests\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700.manifest to C:\foo and renamed it to Microsoft.VC80.CRT.manifest.

The fourth line of the manifest file looked like this:

<assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.762"
                  processorArchitecture="x86"
                  publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>

On trying to run C:\foo\foo.exe now I got the same errors mentioned in the previous section.

Copying CRT DLLs and manifest from Visual Studio folder fixed it.

  1. Copied msvcm80.dll, msvcp80.dll, msvcr80.dll and Microsoft.VC80.CRT.manifest from C:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT of Windows XP machine (where I developed and built foo.exe) to C:\foo of Windows Server 2003 machine (where I am trying to run it).

The fourth line of the manifest file looked like this:

<assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.6195"
                  processorArchitecture="x86"
                  publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>

This time I could run C:\foo\foo.exe without any issues.

Question

I was expecting that installing 'Microsoft Visual C++ 2005 SP1 Redistributable' (vcredist_x86.exe) as described in the second approach would fix it. But it didn't. Copying the DLLs and manifest files from the C:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT folder of the development machine fixed it. Why was it so?

Build options

In case, it helps you to answer my question. Here is the compiler and linker options I picked up from 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 answer my own question. Comments to the question by Hans Passant and Luke helped.

I downloaded Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package MFC Security Update and installed it on the system where I was trying to run C:\foo\foo.exe. The EXE ran fine after this.

The installer placed the CRT DLLs in C:\windows\winsxs\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262b86. So, yes, 8.0.50727.6195 was the version of the CRT DLLs I was looking for as Hans Passant rightly said.

The easiest way to figure this version was by looking at the manifest file generated by Visual Studio while building my project on the development system. Mine was located at C:\Foo\Release\Foo.exe.intermediate.manifest. It had a tag like this:

<assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.6195'
                  processorArchitecture='x86'
                  publicKeyToken='1fc8b3b9a1e18e3b' />

So, this is a clue that I needed 8.0.50727.6195 version of the DLLs. The rest was a matter of searching for the right vcredist_x86.exe which happened to be in the URL I have mentioned in the second paragraph. The page in that URL contains a link to KB2538242 which shows the version numbers of the DLLs that would be installed by the installer.

Note: As Elie has mentioned in a different answer to this question, since this is a 32-bit application, it is necessary to install vcredist_x86.exe (not vcredist_x64.exe) on the system where this application is supposed to be run irrespective of whether that system is a 32-bit Windows system or a 64-bit Windows system. Once again, the .manifest file provides this clue in the processorArchitecture attribute.

这篇关于为什么在我在一台机器上开发EXE并在另一台机器上运行EXE时,安装vcredist_x86.exe无法修复SideBySide错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆