2017-01-09 77 views
1

我的NuGet的打包上傳過程中有TFS(版本15.105.25910.0)一個問題:TFS - 包中409衝突上傳

****************************************************************************** 
Starting task: NuGet Publisher 
****************************************************************************** 
Set workingFolder to default: C:\BuildSystem\TfsAgent\tasks\NuGetPublisher\0.2.21 
C:\Windows\system32\chcp.com 65001 
Active code page: 65001 
Detected NuGet version 3.3.0.212/3.3.0 
SYSTEMVSSCONNECTION exists true 
C:\BuildSystem\TfsAgent\tasks\NuGetPublisher\0.2.21\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe push -NonInteractive C:\BuildSystem\TfsAgent\_work\6\s\myfolderPackage\bin\Release\mypackage.1.16.1905.nupkg -Source HunextPackages -ApiKey VSTS 
Pushing mypackage 1.16.1905 to 'https://mytfsurl.com:444/tfs/DefaultCollection/_packaging/9ebd459f-9a02-456e-9243-c8d0f989c871/nuget/v2/'... 
Failed to process request. 'Conflict'. 
The remote server returned an error: (409) Conflict.. 
Error: C:\BuildSystem\TfsAgent\tasks\NuGetPublisher\0.2.21\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe failed with return code: 1 
Packages failed to publish 
****************************************************************************** 
Finishing task: NuGetPublisher 
****************************************************************************** 
System.Exception: Task NuGetPublisher failed. This caused the job to fail. Look at the logs for the task for more details. 
at Microsoft.TeamFoundation.DistributedTask.Worker.JobRunner.Run(IJobContext jobContext, IJobRequest job, IJobExtension jobExtension, CancellationTokenSource tokenSource) 
Worker Worker-bbe2b68d-3dfb-4b56-8546-bc2935a3ffe1 finished running job bbe2b68d-3dfb-4b56-8546-bc2935a3ffe1 
****************************************************************************** 
Finishing Build 
****************************************************************************** 

我用包管理上TFS和遠程服務器返回了409的衝突,但在軟件包列表我看不到我的「mypackage 01.16.1905」。 包裹的物理存儲位置在哪裏? 謝謝。

+0

你正在上傳相同的版本包嗎? –

+0

yes @ Eddie-MSFT是相同版本的軟件包。我在上傳過程中運行了sql server profiler,並將表格用作存儲,但操作邏輯對我來說非常複雜。你有什麼想法嗎?謝謝 – cirio

回答

0

對於故障排除,您可以嘗試在普通PowerShell控制檯中手動運行它,而不是在構建步驟中運行它。

而根據你的日誌,看起來你正在使用nuget 3.3。嘗試使用nuget 3.5或更高版本以使用TFS打包功能,這是由於3.5版中的某些auth修復引起的。您可以在構建定義中的Nuget任務選項中找到版本切換。

嘗試更新到3.5,看看你是否仍然有問題。還要確保你沒有任何認證問題,nuget可以使用這些信用卡發送給服務器。


更新

它不可能覆蓋在TFS現有的包。 Nuget.exe允許通配符用於推送,因此您可以使用nuget push *.nupkg -Source ....爲此,它將發佈最新版本。

+0

我試着用這個版本更新nuget控制檯應用程序https://dist.nuget.org/win-x86-commandline/v3.5.0/NuGet.exe,但我在本地有同樣的問題。這可能是由於「包裹的不變性」? https://www.visualstudio.com/it-it/docs/package/feeds/immutability。謝謝 – cirio

+0

是的,這應該是根本原因。由於你在本地有同樣的問題。作爲鏈接,nuget會保留你的機器上的軟件包的本地緩存。一旦客戶端緩存了特定的軟件包@版本,它就會在將來的安裝/恢復請求中返回該副本。 –

+0

無法覆蓋TFS上的現有軟件包。 Nuget.exe允許**通配符**用於推送,因此您可以使用'nuget push * .nupkg -Source ....'爲此,它將發佈最新版本。 –