2
在這個Selenium測試項目中,我直接參考了Unity 3.0.0.0。裝配綁定 - 使用Unity的錯誤版本,但爲什麼?
我引用了其他引用Unity的2.505.0.2的DLL。
我有這個在我的app.config:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.ServiceLocation" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.0.0" newVersion="1.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.Unity" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="AutoMapper" publicKeyToken="be96cd2c38ef1005" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.2.1.0" newVersion="3.2.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
我預期使用統一的V3,但它一直試圖用舊的。綁定日誌是:
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 11.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\vstest.executionengine.x86.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = INT\UKTHJHAR
LOG: DisplayName = Microsoft.Practices.Unity, Version=2.1.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///C:/Audatex/Retail/Development/Server/AudaRetailAdministration.AutomatedUITests/bin/Debug
LOG: Initial PrivatePath = NULL
Calling assembly : AudaRetailAdministration.AutomatedUITests, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Audatex\Retail\Development\Server\AudaRetailAdministration.AutomatedUITests\bin\Debug\AudaRetailAdministration.AutomatedUITests.dll.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.Practices.Unity, Version=2.1.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Audatex/Retail/Development/Server/AudaRetailAdministration.AutomatedUITests/bin/Debug/Microsoft.Practices.Unity.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
感謝您花時間回答這個問題。儘管如此,我並不完全相信你的回答,因爲我已經完成了完成此項目的項目,並重定向了未直接引用的程序集。 – 2014-10-09 12:25:55
在其他項目中,這些程序集是否也被強調命名?我確實得到了這個具有這個特定配置的項目的錯誤。 – Bombinosh 2014-10-09 12:47:52