【发布时间】:2014-02-02 19:53:48
【问题描述】:
我正在努力从命令行发布项目。以下是我采取的步骤:
创建了一个全新的
ASP.NET MVC 3 (internet) projectinVisual Studio 2012使用发布向导添加了发布
File System配置文件并指定了目标目录。点击发布成功将应用部署到指定位置。
添加了第二个发布配置文件,但这次是
Web Deploy轮廓。指定服务器、站点名称、用户名和 我用来remote desktop的帐户的密码 服务器。点击Validate Connection。它显示一个小“勾号” 表示成功的图片。点击发布成功将应用部署到远程服务器。
总之,当我在 Visual Studio 中使用发布向导时,我可以成功地部署到本地文件系统或使用 Web 部署的远程服务器。
然后我切换到命令行
msbuild MyMVCProject.csproj /p:DeployOnBuild=true /p:PublishProfile=PublishToFileSystem.pubxml /p:VisualStudioVersion=11.0
成功部署到本地文件系统。
然而
msbuild MyMVCProject.csproj /p:DeployOnBuild=true /p:PublishProfile=BuildServer.pubxml /p:VisualStudioVersion=11.0 /p:AllowUntrustedCertificate=true
返回以下错误:
msdeploy error ERROR_USER_UNAUTHORIZED: Web deployment task failed. (Connected to the remote computer ("10.0.1.6") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.)
它在错误消息中提到的页面并没有真正帮助我。
谁能帮忙,为什么我可以从 Visual Studio 发布向导而不是从命令行部署而没有问题?
【问题讨论】:
标签: visual-studio visual-studio-2012 msbuild