关闭

解决Windows应用程序不能加载C++组件 Side-by-Side错误

458人阅读 评论(0) 收藏 举报
分类:

起因

前两天写了个小工具,在我的机器跑得好好的,QA的测试机里面却死活跑不起来,一运行就出现一个圣诞框,报一个side by side的错误:

The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.

郁闷至极,不过这个对话框却提供了一点额外的信息:

use the command-line sxstrace.exe tool for more detail

于是Google了一下,sxstrace.exe是一个跟踪调试应用程序的工具,看起来很不错的样子。

解决过程

按照 这个 帖子,先打开sxstrace.exe的调试模式:

sxstrace trace -logfile:C:/trace.bin

然后再打开应用程序,这时候在C盘根目录的trace.bin已经生成了,于是退出sxstrace,再运行以下命令:

sxstrace parse -logfile:C:/trace.bin -outfile:C:/trace.log

因为sxstrace trace出来的文件是二进制的,所以用上述命令将其转换成txt的。

打开trace.log,内容如下:

=================
Begin Activation Context Generation.
Input Parameter:
    Flags = 0
    ProcessorArchitecture = Wow32
    CultureFallBacks = en-US;en
    ManifestPath = C:\Users\ADMINI~1\AppData\Local\Temp\1\7zS4BF7914E\installer.exe
    AssemblyDirectory = C:\Users\ADMINI~1\AppData\Local\Temp\1\7zS4BF7914E\
    Application Config File =
-----------------
INFO: Parsing Manifest File C:\Users\ADMINI~1\AppData\Local\Temp\1\7zS4BF7914E\installer.exe.
    INFO: Manifest Definition Identity is (null).
    INFO: Reference: Microsoft.VC90.CRT,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:\Users\ADMINI~1\AppData\Local\Temp\1\7zS4BF7914E\Microsoft.VC90.CRT.DLL.
                INFO: Attempt to probe manifest at C:\Users\ADMINI~1\AppData\Local\Temp\1\7zS4BF7914E\Microsoft.VC90.CRT.MANIFEST.
                INFO: Attempt to probe manifest at C:\Users\ADMINI~1\AppData\Local\Temp\1\7zS4BF7914E\Microsoft.VC90.CRT\Microsoft.VC90.CRT.DLL.
                INFO: Attempt to probe manifest at C:\Users\ADMINI~1\AppData\Local\Temp\1\7zS4BF7914E\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.

看起来是 Microsoft.VC90.CRT.dll 这个reference没有找到,这个是属于 Visual C++ 2008 Redistributable 的一个动态链接库。去M$的网站下一个装上,一切就OK了。

总结

写这篇blog主要是为了记录 sxstrace.exe 这个 工具,感觉用来debug不错。

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:156745次
    • 积分:3306
    • 等级:
    • 排名:第10600名
    • 原创:176篇
    • 转载:26篇
    • 译文:0篇
    • 评论:3条
    文章分类