"The application has failed to start because its side-by-side configuration is incorrect."

背景:

      前段时间写了一个exe程序,一直以来运行在xp,server 2003上面,都运行良好。最近需要把它重新部署到一台新的server上面,是Windows server 2008 R2 Standard版,不想却一直不能正常运行。

 

症状:

      当双击运行程序时,弹出错误窗口,如下:

 

打开 Event Viewer,错误信息如下:

Activation context generation failed for "C:/xxx/xxxxx/xxx.exe". Dependent Assembly Microsoft.VC90.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8" could not be found. Please use sxstrace.exe for detailed diagnosis.

 

继续,用sxstrace.exe 来跟踪错误:

1. 开始运行

C:/Windows/system32>sxstrace.exe trace -logfile:c:/mytrace.etl
Tracing started. Trace will be saved to file c:/mytrace.etl.
Press Enter to stop tracing...

2. 双击应用程序,重现错误

3. 关闭上面运行的sxstrace.exe

4. 导出错误信息

C:/Windows/system32>sxstrace.exe parse -logfile:c:/mytrace.etl -outfile:c:/mytrace.txt
Parsing log file c:/mytrace.etl...
Parsing finished! Output saved to file c:/mytrace.txt.

 

错误信息如下:

=================
Begin Activation Context Generation.
Input Parameter:
    Flags = 0
    ProcessorArchitecture = Wow32
    CultureFallBacks = en-US;en
    ManifestPath = C:/xxx/xxxxx/xxx.exe
    AssemblyDirectory = C:/xxx/xxxxx/
    Application Config File =
-----------------
INFO: Parsing Manifest File C:/xxx/xxxxx/xxx.exe.
    INFO: Manifest Definition Identity is (null).
    INFO: Reference: Microsoft.VC90.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"
    INFO: Reference: Microsoft.VC90.MFC,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"
INFO: Resolving reference Microsoft.VC90.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8".
    INFO: Resolving reference for ProcessorArchitecture WOW64.
        INFO: Resolving reference for culture Neutral.
            INFO: Applying Binding Policy.
                INFO: No publisher policy found.
                INFO: No binding policy redirect found.
            INFO: Begin assembly probing.
                INFO: Did not find the assembly in WinSxS.
                INFO: Attempt to probe manifest at C:/Windows/assembly/GAC_32/Microsoft.VC90.CRT/9.0.21022.8__1fc8b3b9a1e18e3b/Microsoft.VC90.CRT.DLL.
                INFO: Did not find manifest for culture Neutral.
            INFO: End assembly probing.
    INFO: Resolving reference for ProcessorArchitecture x86.
        INFO: Resolving reference for culture Neutral.
            INFO: Applying Binding Policy.
                INFO: No publisher policy found.
                INFO: No binding policy redirect found.
            INFO: Begin assembly probing.
                INFO: Did not find the assembly in WinSxS.
                INFO: Attempt to probe manifest at C:/Windows/assembly/GAC_32/Microsoft.VC90.CRT/9.0.21022.8__1fc8b3b9a1e18e3b/Microsoft.VC90.CRT.DLL.
                INFO: Attempt to probe manifest at C:/carryquote/ServiceSHFE/Microsoft.VC90.CRT.DLL.
                INFO: Attempt to probe manifest at C:/carryquote/ServiceSHFE/Microsoft.VC90.CRT.MANIFEST.
                INFO: Attempt to probe manifest at C:/carryquote/ServiceSHFE/Microsoft.VC90.CRT/Microsoft.VC90.CRT.DLL.
                INFO: Attempt to probe manifest at C:/carryquote/ServiceSHFE/Microsoft.VC90.CRT/Microsoft.VC90.CRT.MANIFEST.
                INFO: Did not find manifest for culture Neutral.
            INFO: End assembly probing.
    ERROR: Cannot resolve reference Microsoft.VC90.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8".
ERROR: Activation Context generation failed.
End Activation Context Generation.

 

解决:

首先,C:/Windows/winsxs/Manifests 文件夹下面只有 x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.30729.1_none_dcc7eae99ad0d9cf 的 manifest 和 cat文件,但是没有找到 x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91 的 cat 和 manifest 文件。

所以可能是由于服务器中并没有安装关于 vs2008 的相关组件,所以产生上述错误。

 

从microsoft 官网下载 vcredist 程序, 安装之后,一切OK。

http://www.microsoft.com/downloads/en/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en

 

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值