繁体   English   中英

msdeploy错误ERROR_USER_UNAUTHORIZED:Web部署任务失败。使用IIS7,TFS2010,VS2012

[英]msdeploy error ERROR_USER_UNAUTHORIZED: Web deployment task failed. using IIS7, TFS2010, VS2012

使用Visual Studio 2012,TFS 2010,IIS7

尝试构建/部署时出现以下错误:

Any CPU | Test
1 error(s), 1 warning(s)

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets      
(4253): Web deployment task failed. (Connected to the remote computer ("server1") 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.)

*snip warning*

Other Errors and Warnings
2 error(s), 0 warning(s)
Building the projects in this solution one at a time. To enable parallel build, please 
add the "/m" switch.
TF270015: 'MSBuild.exe' returned an unexpected exit code. Expected '0'; actual '1'.
  • 我验证了该站点存在于IIS中
  • 我验证我的用户名和密码正确(我能登录服务器)
  • 用户是tfs服务器上的管理员

我的tfs服务器上没有VS2012,但是有人将他们的C:\\ Program Files(x86)\\ MSBuild \\ Microsoft \\ VisualStudio \\ v11.0文件夹复制到tfs服务器,以便在一段时间内修复另一个构建问题。 我将相同的文件夹复制到“server1”,没有更改错误消息。

它仍然创建构建,只是不部署。

我们能够通过以下步骤解决问题:

  • 在IIS管理器中突出显示该网站
  • 在“功能”视图中,打开IIS管理器权限
  • 验证您正在部署的用户是否已添加。 如果没有,请单击“允许用户”并添加。

希望这可以帮助!

我的密码和下一个构建参数之间没有空格,所以密码在技术上是错误的。

/p:UserName=scw /p:Password=12345/p:VisualStudioVersion=11.0
/p:UserName=scw /p:Password=12345 /p:VisualStudioVersion=11.0

如果指定了错误的站点名称,则会发生这种情况。 您必须输入IIS Connections中显示的名称,例如Default Web Site

在此输入图像描述

我在一个环境中遇到了同样的问题而在另一个环境中没有。 我的问题是我没有在计算机名前加上用户名(即p:UserName = testserver \\ admin vs p:UserName = admin)。 在我的工作环境中,两台服务器都通过Active Directory使用了一个帐户,所以这不是问题。 学过的知识!

我建议不要使用Team Build进行部署。 我假设它正在为每个部署进行编译。 这不是一个好主意,因为编译器之间的事情可能会发生变化,因为编译器不是100%。 您最好使用部署工具进行二进制部署。 我已经非常有效地使用了Visual Studio 2013的发布管理来从Dev-> QA-> Prod部署相同的二进制文件...

您可以从Visual Studio 2013获取有关Professional Application Lifecycle Management的信息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM