我已經出現我的生成服務器上的以下錯誤(TFS/Visual Studio的在線):程序集引用無法解析 - dependentAssembly問題?
CA0055 : Could not load C:\a\Binaries\Api.dll. The following error was encountered while reading module 'System.Net.Http.Formatting': Assembly reference cannot be resolved: Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed.
CA0058 : The referenced assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' could not be found. This assembly is required for analysis and was referenced by: C:\a\Binaries\Api.dll, C:\a\Sources\MyLocation\packages\Microsoft.AspNet.WebApi.Client.5.1.1\lib\net45\System.Net.Http.Formatting.dll.
這裏是我的Api.dll項目本次大會的web.config
dependentAssembly
項:
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
已安裝的Json.NET NuGet包的實際版本爲6.0.1:
當項目引用看,我有Newtonsoft.Json爲6.0.0.0:
的System.Net.Http.Formatting
中引用的版本是5.1.0.0。
在構建定義中啓用了NuGet還原,並且我的本地副本上沒有這些錯誤,僅在TFS中。
是否有人能夠發現可能存在的問題?
我認爲這可能是由於dependentAssembly
條目,但我無法讓它工作。
要診斷綁定錯誤,請使用Fusion Viewer:http://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.110).aspx。 – Polyfun