2011-06-09 74 views
0

我有一個使用CRT版本8.0.50727.5592的應用程序。其中一個依賴庫使用版本8.0.50727.762。當我在安裝了8.0.50727.4940版本的機器上運行該應用程序時,出現「並排配置不正確」錯誤。使用sxstrace,我得到以下結果:如何解決「兩個同名的程序集」

================= 
Begin Activation Context Generation. 
Input Parameter: 
    Flags = 0 
    ProcessorArchitecture = AMD64 
    CultureFallBacks = en-US;en 
    ManifestPath = F:\Temp\Temp.exe 
    AssemblyDirectory = F:\Temp\ 
    Application Config File = F:\Temp\Temp.exe.Config 
----------------- 
INFO: Parsing Application Config File F:\Temp\Temp.exe.Config. 
INFO: Parsing Manifest File F:\Temp\Temp.exe. 
    INFO: Manifest Definition Identity is (null). 
    INFO: Reference: Microsoft.VC80.CRT,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762" 
    INFO: Reference: Microsoft.VC80.CRT,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.5592" 
INFO: Resolving reference Microsoft.VC80.CRT,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.762". 
    INFO: Resolving reference for ProcessorArchitecture amd64. 
     INFO: Resolving reference for culture Neutral. 
      INFO: Applying Binding Policy. 
       INFO: Find publisher policy at C:\Windows\WinSxS\manifests\amd64_policy.8.0.microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4940_none_09c03a53facd313f.manifest 
       INFO: Publisher Policy redirected assembly version. 
       INFO: Post policy assembly identity is Microsoft.VC80.CRT,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.4940". 
      INFO: Begin assembly probing. 
       INFO: Attempt to probe manifest at C:\Windows\WinSxS\manifests\amd64_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4940_none_88df89932faf0bf6.manifest. 
       INFO: Manifest found at C:\Windows\WinSxS\manifests\amd64_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4940_none_88df89932faf0bf6.manifest. 
      INFO: End assembly probing. 
INFO: Resolving reference Microsoft.VC80.CRT.mui,language="*",processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.4940". 
    INFO: Resolving reference for ProcessorArchitecture amd64. 
     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_64\Microsoft.VC80.CRT.mui\8.0.50727.4940_en-US_1fc8b3b9a1e18e3b\Microsoft.VC80.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_64\Microsoft.VC80.CRT.mui\8.0.50727.4940_en_1fc8b3b9a1e18e3b\Microsoft.VC80.CRT.mui.DLL. 
       INFO: Did not find manifest for culture en. 
      INFO: End assembly probing. 
INFO: Resolving reference Microsoft.VC80.CRT,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.5592". 
    INFO: Resolving reference for ProcessorArchitecture amd64. 
     INFO: Resolving reference for culture Neutral. 
      INFO: Applying Binding Policy. 
       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_64\Microsoft.VC80.CRT\8.0.50727.5592__1fc8b3b9a1e18e3b\Microsoft.VC80.CRT.DLL. 
       INFO: Attempt to probe manifest at F:\Temp\Microsoft.VC80.CRT.DLL. 
       INFO: Attempt to probe manifest at F:\Temp\Microsoft.VC80.CRT.MANIFEST. 
       INFO: Attempt to probe manifest at F:\Temp\Microsoft.VC80.CRT\Microsoft.VC80.CRT.DLL. 
       INFO: Attempt to probe manifest at F:\Temp\Microsoft.VC80.CRT\Microsoft.VC80.CRT.MANIFEST. 
       INFO: Manifest found at F:\Temp\Microsoft.VC80.CRT\Microsoft.VC80.CRT.MANIFEST. 
      INFO: End assembly probing. 
ERROR: Two assemblies have the same assembly name with different version. Assembly 1: F:\Temp\Microsoft.VC80.CRT\Microsoft.VC80.CRT.MANIFEST. Assembly 2: INFO: Manifest found at F:\Temp\Microsoft.VC80.CRT\Microsoft.VC80.CRT.MANIFEST.. 
ERROR: Activation Context generation failed. 
End Activation Context Generation. 

對我來說,它看起來像被「升級」到4940版的762版本的依賴,而在5592的依賴性顯然不能。

我已將包含CRT版本5592的「Microsoft.VC80.CRT」文件夾複製到我的應用程序文件夾中(即將程序集部署爲專用程序集)。在似乎在年底得到認可,其中sxstrace說:

INFO: Manifest found at F:\Temp\Microsoft.VC80.CRT\Microsoft.VC80.CRT.MANIFEST. 

可惜的是,由於某種原因,當7620版的引用解析,這是沒見過。我如何強制引用版本762指向與我的應用程序一起分發的版本5592?

我錯了我認爲問題是什麼?

感謝您的幫助!

回答

2

機器簡單地缺少應用程序需要的DLL版本。試圖解決這個問題沒什麼意義,它不會走到盡頭。只需部署CRT庫的.5592修訂版即可。該版本將包含一個重定向.792到.5592的策略,因此每個人都使用相同的DLL。

+0

我實際上在發行版中包含了5592版本。出於某種原因,它看起來像系統碰撞高達4940之前,它意識到我已經包括5592.任何想法,爲什麼這可能是頭痛? – 2011-06-10 00:34:03

+0

它正在爲4940找到一個策略,而不是爲5592.這可能是一個已經在機器上的舊的策略。不要忘記在安裝程序中包含策略的合併模塊。 – 2011-06-10 05:32:08

+0

這可能是問題所在。目前我正在使用NSIS,並將CRT文件夾複製到我的程序文件夾中。是否有必要更改安裝程序,還是有其他方法可以解決此問題? – 2011-06-11 15:21:36

相關問題