2017-04-16 245 views
0

我正在使用MSDeploy作爲TFS2017(更新1)中自定義任務的一部分,但無法使setParamFile選項正常工作。它拋出兩個錯誤之一。如果我沒有指定路徑,它會顯示「無法找到文件」(請參閱​​下面的跟蹤)。如果我在生成機器上指定文件的路徑,則表示路徑無效。使用setParamFile時MSDeploy報告「找不到文件」

我確定這簡直是令人難以置信的事情,但它讓我失敗了,而Google一度不是我的朋友!任何幫助是極大的讚賞。

我已經提供了日誌不變,因爲所有這些只在內部服務器上。沒有setParamFile參數,它顯示部署罰款沒有更新我試圖更新的變量連接字符串,顯然。

2017-04-15T22:41:13.5065833Z Executing the powershell script: D:\BuildAgent\tasks\MSDeployPackageMultiSync\1.1.16\MSDeployPackageSync.ps1 2017-04-15T22:41:13.6472111Z packageFile= Find-Files -SearchPattern D:\BuildAgent\_work\194fdc7b9\Data Collection App - Release\drop\_PublishedWebsites\Cabi.FormsAdmin.Api_Package\DCA_API.zip 2017-04-15T22:41:13.6472111Z packageFile= D:\BuildAgent\_work\194fdc7b9\Data Collection App - Release\drop\_PublishedWebsites\Cabi.FormsAdmin.Api_Package\DCA_API.zip 2017-04-15T22:41:13.6784674Z DCA_API.SetParameters.xml 2017-04-15T22:41:13.7097114Z Package= D:\BuildAgent\_work\194fdc7b9\Data Collection App - Release\drop\_PublishedWebsites\Cabi.FormsAdmin.Api_Package\DCA_API.zip 2017-04-15T22:41:13.7097114Z ParamFile= -setParamFile:'DCA_API.SetParameters.xml' 2017-04-15T22:41:13.7097114Z DestinationProvider= auto 2017-04-15T22:41:13.7097114Z DestinationComputer= prerelweb3,prerelweb4 2017-04-15T22:41:13.7097114Z Username= 2017-04-15T22:41:13.7097114Z AdditionalArguments= 2017-04-15T22:41:13.7253453Z Deploying package to prerelweb3,prerelweb4 2017-04-15T22:41:13.7253453Z Deploying to prerelweb3 2017-04-15T22:41:13.7253453Z "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package='D:\BuildAgent\_work\194fdc7b9\Data Collection App - Release\drop\_PublishedWebsites\Cabi.FormsAdmin.Api_Package\DCA_API.zip' -setParamFile:'DCA_API.SetParameters.xml' -dest:auto,computerName='prerelweb3',userName='',password='',authType='ntlm',includeAcls='False' -setParam:name='IIS Web Application Name',value='WebServices (Secure)\FormsAdmin' -setParam:kind=DestinationVirtualDirectory,scope='WebServices (Secure)\\FormsAdmin',value='e:\cabi_sites\WebServices_Secure\FormsAdmin' -allowUntrusted **2017-04-15T22:41:14.1315861Z ##[error]System.Management.Automation.RemoteException: Error: Could not find file ''DCA_API.SetParameters.xml''.** 2017-04-15T22:41:14.1315861Z ##[error]System.Management.Automation.RemoteException: Error count: 1. 2017-04-15T22:41:14.1315861Z Deployment to prerelweb3 complete 2017-04-15T22:41:14.1315861Z Deploying to prerelweb4 2017-04-15T22:41:14.1315861Z "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package='D:\BuildAgent\_work\194fdc7b9\Data Collection App - Release\drop\_PublishedWebsites\Cabi.FormsAdmin.Api_Package\DCA_API.zip' -setParamFile:'DCA_API.SetParameters.xml' -dest:auto,computerName='prerelweb4',userName='',password='',authType='ntlm',includeAcls='False' -setParam:name='IIS Web Application Name',value='WebServices (Secure)\FormsAdmin' -setParam:kind=DestinationVirtualDirectory,scope='WebServices (Secure)\\FormsAdmin',value='e:\cabi_sites\WebServices_Secure\FormsAdmin' -allowUntrusted **2017-04-15T22:41:14.4909648Z ##[error]System.Management.Automation.RemoteException: Error: Could not find file ''DCA_API.SetParameters.xml''.** 2017-04-15T22:41:14.4909648Z ##[error]System.Management.Automation.RemoteException: Error count: 1. 2017-04-15T22:41:14.4909648Z Deployment to prerelweb4 complete

+0

請問您如何在自定義構建任務的task.json文件中定義setParamFile,以及DCA_API.SetParameters.xml位於何處?這是一個已經開發的擴展,也許你可以參考。 https://github.com/rschiefer/MSDeployAllTheThings –

+0

自定義控件源自MSDeployAllTheThings(具有附加參數並已修改爲支持多個服務器部署)。 task.json沒有參數來獲取setParamFile。該位置正在使用包位置並使用.SetParameters.xml替換.zip來確定。該文件是肯定的,因爲我已經檢查過。 –

回答

0

我假設你正在使用此任務:MSDeployAllTheThings。根據日誌,您從Release中使用它。因此,您需要確保在構建過程中將「DCA_API.SetParameters.xml」文件發佈爲工件放置,並且在發佈期間也可以正確下載。然後,您需要在Additional Arguments中輸入絕對路徑,以便任務可以找到該文件。對於您的情況,如果「DCA_API.SetParameters.xml」文件被放置在「DCA_API.zip」文件相同的文件夾,你需要使用這樣的:在我身邊

-setParamFile:"D:\BuildAgent\_work\194fdc7b9\Data Collection App - Release\drop\_PublishedWebsites\Cabi.FormsAdmin.Api_Package\DCA_API.SetParameters.xml" 

我有絕對路徑,並嘗試沒有看到任何問題。

+0

感謝您的回覆。設置文件與zip包的路徑相同,我用它的絕對路徑,它說無效路徑,而不是找不到文件。我也手動檢查過,文件肯定出現在文件夾中。 –

+0

@NeilD您可以在使用絕對路徑時共享日誌嗎? –

+0

@NeilD如果可能,還可以在構建定義中共享任務設置的屏幕截圖。 –

相關問題