我試圖從Bitbucket爲Azure Web App設置連續部署。然而,部署失敗,出現以下錯誤:Azure Web應用程序(MVC 6)持續部署失敗
Command: deploy.cmd
Handling ASP.NET 5 Web Application deployment.
Invoke-Command : Cannot validate argument on parameter 'Architecture'. The
argument "undefined" does not belong to the set ",x86,x64,arm" specified by
the ValidateSet attribute. Supply an argument that is in the set and then try
the command again.
At C:\Program Files
(x86)\SiteExtensions\Kudu\49.41216.1976\bin\scripts\dnvm.ps1:1914 char:9
+ Invoke-Command ([ScriptBlock]::Create("dnvm-$cmd $cmdargs"))
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Invoke-Command], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Power
Failed exitCode=1, command=PowerShell -NoProfile -NoLogo -ExecutionPolicy
unrestricted -Command "
[System.Threading.Thread]::CurrentThread.CurrentCulture = '';
[System.Threading.Thread]::CurrentThread.CurrentUICulture = '';$CmdPathFile='"D:\local\UserProfile\.dnx\temp-set-envvars.cmd"';&
'C:\Program Files (x86)\SiteExtensions\Kudu\49.41216.1976\bin\scripts\dnvm.ps1' " install undefined -arch undefined -r undefined
Shell.Commands.InvokeCommandCommand
An error has occurred during web site deployment.
直接從Visual Studio 2015發佈/部署工作沒有任何問題。似乎dnvm.ps1命令傳遞了一堆導致此錯誤的「未定義」參數。通過運行
azure site deploymentscript --aspNet5 <path to the project.json file>
創建本地部署腳本(as instructed here)也將產生同樣具有「未定義」變量deploy.cmd。
我不使用任何自定義部署腳本和我global.json樣子:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-rc1-update1"
}
}
我們從BitBucket部署沒有問題。您的存儲庫是否包含任何部署腳本,或者您是否讓它自動生成?您是否使用global.json文件來定義您使用的是哪個框架版本? –
我在上面的問題中添加了我的global.json。我沒有使用任何自定義部署腳本。感謝您的幫助! –