我努力从命令行发布项目。下面是我所采取的步骤:增加使用发布向导并指定目标目录中发布File System
轮廓Visual Studio 2012从命令行发布
创建新
ASP.NET MVC 3 (internet) project
一个品牌Visual Studio 2012
。
点击发布成功地将应用程序部署到指定的位置。
添加了第二个发布配置文件,但这次是
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发布向导而不是从命令行部署问题?