用系统工具sxstrace检查缺少的VC运行时组件

在管理员运行的命令提示符中输入sxstrace获得如下帮助:

C:\>sxstrace
WinSxs Tracing Utility.
Usage: SxsTrace [Options]
Options:
   Trace -logfile:FileName [-nostop]
       Enabling tracing for sxs.
       Tracing log is saved to FileName.
       If -nostop is specified, will not prompt to stop tracing.
   Parse -logfile:FileName -outfile:ParsedFile  [-filter:AppName]
       Translate the raw trace file into a human readable format and save the result to ParsedFile.
       Use -filter option to filter the output.
   Stoptrace
       Stop the trace if it is not stopped before.
Example:  SxsTrace Trace -logfile:SxsTrace.etl
          SxsTrace Parse -logfile:SxsTrace.etl -outfile:SxsTrace.txt

选项:

Trace 开始跟踪,并生成跟踪日志文件。

Parse 解析跟踪日志文件为文本文件。

Stoptrace 停止跟踪。

使用方法:

1)在管理员运行的命令提示符里输入下面命令开始跟踪

C:\>sxstrace trace -logfile:sxstrace.etl
Tracing started. Trace will be saved to file sxstrace.etl.
Press Enter to stop tracing...

2)启动一个有问题的程序(这里以一个Thunder.exe为例)

点OK关闭错误提示。

3)回到命令提示符里,按回车键(Enter)停止跟踪。sxstrace.etl文件已经生成,然后输入下面命令解析sxstrace.etl

C:\>sxstrace parse -logfile:sxstrace.etl -outfile:sxstrace.txt
Parsing log file sxstrace.etl...
Parsing finished! Output saved to file sxstrace.txt.

C:\>notepad sxstrace.txt

C:\>

打开sxstrace.txt

=================
Begin Activation Context Generation.
Input Parameter:
	Flags = 0
	ProcessorArchitecture = Wow32
	CultureFallBacks = en-US;en
	ManifestPath = C:\Program Files (x86)\Thunder\Program\Thunder.exe
	AssemblyDirectory = C:\Program Files (x86)\Thunder\Program	Application Config File =
-----------------
INFO: Parsing Manifest File C:\Program Files (x86)\Thunder\Program\Thunder.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.ATL,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: Find publisher policy at C:\Windows\WinSxS\manifests\x86_policy.9.0.microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9158_none_f47f259ef656232a.manifest
				INFO: Publisher Policy redirected assembly version.
				INFO: Post policy assembly identity is Microsoft.VC90.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.30729.9158".
			INFO: Begin assembly probing.
				INFO: Attempt to probe manifest at C:\Windows\WinSxS\manifests\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9158_none_5091b51ebcb97cdc.manifest.
				INFO: Manifest found at C:\Windows\WinSxS\manifests\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9158_none_5091b51ebcb97cdc.manifest.
			INFO: End assembly probing.
INFO: Resolving reference Microsoft.VC90.CRT.mui,language="*",processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.30729.9158".
	INFO: Resolving reference for ProcessorArchitecture WOW64.
		INFO: Resolving reference for culture en-US.
			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.mui\9.0.30729.9158_en-US_1fc8b3b9a1e18e3b\Microsoft.VC90.CRT.mui.DLL.
				INFO: Did not find manifest for culture en-US.
			INFO: End assembly probing.
		INFO: Resolving reference for culture en.
			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.mui\9.0.30729.9158_en_1fc8b3b9a1e18e3b\Microsoft.VC90.CRT.mui.DLL.
				INFO: Did not find manifest for culture en.
			INFO: End assembly probing.
	INFO: Resolving reference for ProcessorArchitecture x86.
		INFO: Resolving reference for culture en-US.
			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.mui\9.0.30729.9158_en-US_1fc8b3b9a1e18e3b\Microsoft.VC90.CRT.mui.DLL.
				INFO: Did not find manifest for culture en-US.
			INFO: End assembly probing.
		INFO: Resolving reference for culture en.
			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.mui\9.0.30729.9158_en_1fc8b3b9a1e18e3b\Microsoft.VC90.CRT.mui.DLL.
				INFO: Did not find manifest for culture en.
			INFO: End assembly probing.
INFO: Resolving reference Microsoft.VC90.ATL,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.ATL\9.0.21022.8__1fc8b3b9a1e18e3b\Microsoft.VC90.ATL.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.ATL\9.0.21022.8__1fc8b3b9a1e18e3b\Microsoft.VC90.ATL.DLL.
				INFO: Attempt to probe manifest at C:\Program Files (x86)\Thunder\Program\Microsoft.VC90.ATL.DLL.
				INFO: Attempt to probe manifest at C:\Program Files (x86)\Thunder\Program\Microsoft.VC90.ATL.MANIFEST.
				INFO: Attempt to probe manifest at C:\Program Files (x86)\Thunder\Program\Microsoft.VC90.ATL\Microsoft.VC90.ATL.DLL.
				INFO: Attempt to probe manifest at C:\Program Files (x86)\Thunder\Program\Microsoft.VC90.ATL\Microsoft.VC90.ATL.MANIFEST.
				INFO: Did not find manifest for culture Neutral.
			INFO: End assembly probing.
	ERROR: Cannot resolve reference Microsoft.VC90.ATL,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8".
ERROR: Activation Context generation failed.
End Activation Context Generation.

sxstrace.txt

搜索ERROR,发现错误描述:

ERROR: Cannot resolve reference Microsoft.VC90.ATL,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8".
ERROR: Activation Context generation failed.

意思是缺少VC90运行库。然后去微软下载这个运行库安装就修复了运行库依赖问题了。



VC++运行时的所有版本:https://support.microsoft.com/en-us/kb/2977003

摘录如下:

Visual Studio 2013 (VC++ 12.0)
Microsoft Visual C++ Redistributable Packages for Visual Studio 2013
http://www.microsoft.com/en-us/download/details.aspx?id=40784

Visual Studio 2012 (VC++ 11.0)
Microsoft Visual C++ Redistributable Packages for Visual Studio 2012 Update 4
http://www.microsoft.com/en-us/download/details.aspx?id=30679

Visual Studio 2010 (VC++ 10.0) SP1
Microsoft Visual C++ 2010 Service Pack 1 Redistributable Package MFC Security Update
http://www.microsoft.com/download/en/details.aspx?id=26999

Visual Studio 2008 (VC++ 9.0) SP1
Microsoft Visual C++ 2008 Service Pack 1 Redistributable Package MFC Security Update
http://www.microsoft.com/download/en/details.aspx?id=26368

Visual Studio 2005 (VC++ 8.0) SP1
Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package MFC Security Update
http://www.microsoft.com/download/en/details.aspx?id=26347

-

时间: 2024-10-26 00:52:18

用系统工具sxstrace检查缺少的VC运行时组件的相关文章

VC 运行时库 /MD、/MDd 和 /MT、/MTd

这里总结下他们的区别,后面的那个'd'是代表DEBUG版本,没有'd'的就是RELEASE版本了. 首先说/MT /MT是 "multithread, static version ” 意思是多线程静态的版本,定义了它后,编译器把LIBCMT.lib 安置到OBJ文件中,让链接器使用LIBCMT.lib 处理外部符号. /MD是 "multithread- and DLL-specific version” ,意思是多线程DLL版本,定义了它后,编译器把 MSVCRT.lib 安置到O

转 VC 运行时库 /MD、/MDd 和 /MT、/MTd

来自 http://qimo601.iteye.com/blog/1550348 这里总结下他们的区别,后面的那个'd'是代表DEBUG版本,没有'd'的就是RELEASE版本了. 首先说/MT /MT是 "multithread, static version ” 意思是多线程静态的版本,定义了它后,编译器把LIBCMT.lib 安置到OBJ文件中,让链接器使用LIBCMT.lib 处理外部符号. /MD是 "multithread- and DLL-specific version

java 检查抛出的异常是否是要捕获的检查性异常或运行时异常或错误

/** * Return whether the given throwable is a checked exception: * that is, neither a RuntimeException nor an Error. * @param ex the throwable to check * @return whether the throwable is a checked exception * @see java.lang.Exception * @see java.lang

定位vc运行时库问题 依赖问题,屡试不爽的一招

用vc 菜单 文件| 打开|指定EXE或DLL,如有指定运行时库,则PE文件的资源中可以看到manifest 配置节 然后据此判断EXE依赖的运行时库, 再根据编译选项调整 运行时库设置

系统常用VC++运行时下载地址

Microsoft Visual C++ 2005 Microsoft Visual C++ 2005 Redistributable Package (x86) https://www.microsoft.com/zh-cn/download/details.aspx?id=3387 Microsoft Visual C++ 2005 Redistributable Package (x64) https://www.microsoft.com/zh-cn/download/details.a

VC运行时库(/MD、/MT等)

/MT 运行时库 http://www.cnblogs.com/kex1n/archive/2013/04/02/2995791.html http://blog.csdn.net/lyq240919525/article/details/40402909 我的工程是VS2010的控制台程序,要用到一个VS2008的库.结果release下没有任何问题,到了debug下会提示应用程序配置不正确-- 初步查了一下资料,是因为没有VS2008的Debug版本的共享并行程序集而Release版本电脑上

[精通Objective-C]进阶技巧:使用运行时系统API

[精通Objective-C]进阶技巧:使用运行时系统API 参考书籍:<精通Objective-C>[美] Keith Lee 什么是运行时系统? 目录 精通Objective-C进阶技巧使用运行时系统API 目录 动态加载可选包 创建命令行程序 创建可选包 传入包路径 使用可选包 运行时系统API 动态代理 创建实现横切功能的协议和类 编写代理类 添加代理的目标类 测试动态代理程序 动态加载可选包 下面是使用NSbundle API动态加载自己编写的框架包的示例,共需要创建两个工程,一个命

[精通Objective-C]运行时系统

[精通Objective-C]运行时系统 参考书籍:<精通Objective-C>[美] Keith Lee 目录 精通Objective-C运行时系统 目录 运行时系统概述 对象消息 选择器 方法签名 使用对象消息 动态类型 动态绑定 动态方法决议 动态加载 内省 运行时系统的组成部分 编译器 运行时系统库 元类 与运行时系统交互 运行时系统概述 Objective-C拥有相当多的动态特性,这些特性在运行程序时发挥作用,而不是在编译或链接代码时发挥作用.Objective-C运行时系统实现了

区分运行时异常和受检查异常【文摘+转】

正确运用异常处理机制,有助于提高程序的健壮性. 所谓程序的健壮性,就是指程序在多数情况下能够正常运行,返回预期的正确结果:如果偶尔遇到异常情况,程序也能采取周到的解决措施. 受检查异常表示程序可以处理的异常,如果抛出异常的方法本身不能处理它,那么方法调用者应该去处理它,从而使程序恢复运行,不至于终止程序.例如,喷墨打印机在打印文件时,如果纸用完或者墨水用完,就会暂停打印,等待用户添加打印纸或更换墨盒,如果用户添加了打印纸或更换了墨盒,就能继续打印. 可以用OutOfPaperException类