- TFS 2015年更新2
- 構建代理是Windows 2012服務器
- 的Visual Studio 2015年更新2上構建系統安裝在運行
我有一個在安裝了VS 2015 Update 2的代理上運行的構建(新)定義。我有一個項目中有幾個NuGet包。直到今天下午,該構建按預期工作。我就其中它把完成後的建立一些變化,然後我就開始收到此錯誤:
2016-04-28T16:35:03.3605826Z Set workingFolder to default: E:\agent\tasks\NuGetInstaller\0.1.17
2016-04-28T16:35:03.4073604Z Executing the powershell script: E:\agent\tasks\NuGetInstaller\0.1.17\NuGetInstaller.ps1
2016-04-28T16:35:05.0948829Z Saving to E:\agent_work\1\NuGet\newNuGet.config
2016-04-28T16:35:05.1418632Z E:\agent\agent\worker\tools\NuGet.exe restore "E:\agent_work\1\s\Dev\eCommerce\Consol.eCommerce.sln" -NonInteractive -configfile "E:\agent_work\1\NuGet\newNuGet.config"
2016-04-28T16:35:05.8761260Z MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'.
2016-04-28T16:35:06.6105618Z Restoring NuGet package System.Reflection.Metadata.1.2.0.
2016-04-28T16:35:08.9542747Z WARNING: Unable to find version '1.2.0' of package 'System.Reflection.Metadata'.
2016-04-28T16:35:09.0012648Z ##[error]Unable to find version '1.2.0' of package 'System.Reflection.Metadata'.
2016-04-28T16:35:09.0323998Z ##[error]Unexpected exit code 1 returned from tool NuGet.exe
現在,這是我迷路了,我檢查NuGet.org和包,這個版本存在。我甚至在我的本地系統中刪除了項目中的所有軟件包,然後做了一個NuGet軟件包還原,它工作得很好。我從項目中刪除了NuGet包,並重新添加它,它工作正常。
有沒有人看到這個,知道如何解決它?
更新時間29/4/2016: 正如我在下面的評論中所說,我已經整理出來了。 我原來nuget.config文件是這樣的
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageSources>
<add key="NuGet official package source v2" value="https://nuget.org/api/v2/" />
<add key="FelineSoft NuGet" value="http://prod-tfs15:81/nuget" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>
我改成了這一點,它的工作
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageSources>
<add key="NuGet official package source v3" value="https://api.nuget.org/v3/index.json" />
<add key="NuGet official package source v2" value="https://nuget.org/api/v2/" />
<add key="FelineSoft NuGet" value="http://prod-tfs15:81/nuget" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>
新的問題是,爲什麼這個API終點事對於這樣的評論包?
我昨天和今天多次這樣做過,但最終在今天早上把它整理出來了,但這個解決方案比問題更不明智。我將更新問題以顯示我找到的解決方案。 –
System.Reflection.Metadata 1.2.0只需要NuGet 2.8.6或更高版本。對於NuGet feed v3(VS 2015/NuGet v3.x):https://api.nuget.org/v3/index.json和NuGet feed v2(VS 2013及更早版本/ NuGet 2.x):https:// www.nuget.org/api/v2。由於您使用的是VS2015,因此添加V3網址可能會有訣竅。 –