我在我的构建服务器上(TFS/Visual Studio Online)遇到以下错误:
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项目中有关此程序集的dependentAssembly
条目的web.config
:
<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
条目造成的,但我无法让它工作。