【发布时间】:2016-03-25 20:18:58
【问题描述】:
我正在尝试为来自 Bitbucket 的 Azure Web 应用程序设置连续部署。然而,部署失败并出现以下错误:
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 命令传递了一堆导致此错误的“未定义”参数。通过运行在本地创建部署脚本 (as instructed here)
azure site deploymentscript --aspNet5 <path to the project.json file>
还将生成具有相同“未定义”变量的 deploy.cmd。
我没有使用任何自定义部署脚本,我的 global.json 看起来像:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-rc1-update1"
}
}
【问题讨论】:
-
我们从 BitBucket 部署没有问题。您的存储库是否包含任何部署脚本,或者您是否让它自动生成?您是否使用 global.json 文件来定义您使用的框架版本?
-
我在上面的问题中添加了我的 global.json。我没有使用任何自定义部署脚本。感谢您的帮助!
标签: asp.net asp.net-mvc azure asp.net-core asp.net-core-mvc