用系統工具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

-


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM