硬件升級後,我不得不重新安裝我的系統(Win7)。在升級之前,我還運行了Win7和VS2010,並且我的應用程序在發行版和調試版中運行都沒有問題。現在我編譯和鏈接,但是當我嘗試運行它,我得到:爲什麼我的VS2010本機C++應用程序突然啓動,出現並列錯誤?
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.
事件日誌顯示:
Dependent Assembly Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8" could not be found. Please use sxstrace.exe for detailed diagnosis.
爲特定的可執行文件。我覺得奇怪的是,我在控制面板中的安裝程序中看到了VS2008運行時間。更奇怪的是,它曾經在我的舊裝置上工作了一週。在升級到VS2010之前,我有VS2008,所以也許就是這個原因。無論如何,我也不明白爲什麼VS2010沒有將我的二進制文件與最新的(VC10)運行時庫鏈接起來,而是依賴於(不存在的)VC9.0。我能做些什麼來讓我的應用程序運行?
編輯:我在這裏包括來自sxstrace的輸出。有可執行一些參考,但他們大多看起來是一樣的,我選擇了32位的一個,因爲應用程序被構建爲32位:
F:\cci\Debug>sxstrace Trace -logfile:trace.etl Tracing started. Trace will be saved to file trace.etl. Press Enter to stop tracing...
F:\cci\Debug>sxstrace Parse -logfile:trace.etl -outfile:sxs.out Parsing log file trace.etl... Parsing finished! Output saved to file sxs.out.
sxs.out的內容:
Begin Activation Context Generation.
Input Parameter:
Flags = 0
ProcessorArchitecture = Wow32
CultureFallBacks = en-US;en
ManifestPath = F:\cci\Debug\gui.exe
AssemblyDirectory = F:\cci\Debug\
Application Config File =
INFO: Parsing Manifest File F:\cci\Debug\gui.exe.
INFO: Manifest Definition Identity is (null).
INFO: Reference: Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"
INFO: Resolving reference Microsoft.VC90.DebugCRT,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.DebugCRT\9.0.21022.8__1fc8b3b9a1e18e3b\Microsoft.VC90.DebugCRT.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.DebugCRT\9.0.21022.8__1fc8b3b9a1e18e3b\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at F:\cci\Debug\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at F:\cci\Debug\Microsoft.VC90.DebugCRT.MANIFEST.
INFO: Attempt to probe manifest at F:\cci\Debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at F:\cci\Debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.MANIFEST.
INFO: Did not find manifest for culture Neutral.
INFO: End assembly probing.
ERROR: Cannot resolve reference Microsoft.VC90.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8".
ERROR: Activation Context generation failed.
End Activation Context Generation.
也許它不是直接您的應用程序。你使用其他第三方程序集嗎?其中一個可以建立對抗vc9的東西?當你運行它時,sxstrace.exe會說什麼? – DXM 2011-06-12 18:36:41
是的,我有兩個第三方庫,我是在VS2008下自己編譯的。我想我將不得不使用VS2010重新編譯它們以刪除VS2008 Debug運行時依賴項。 – neuviemeporte 2011-06-12 20:00:08