Web Deploy 3.0在发布时激怒了401错误 [英] Web Deploy 3.0 infuriating 401 error on publish

查看:423
本文介绍了Web Deploy 3.0在发布时激怒了401错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法将一个简单的应用程序部署到我是其管理员的IIS服务器上。以下是我从VS2010获取的错误消息(修改域名以保护无辜者):

I can't seem to get a simple application to deploy to an IIS server that I am the administrator of. Here is the error message I get from VS2010 (domain name modified to protect the innocent):

    ------ Build started: Project: HelloWorldWeb, Configuration: Debug Any CPU ------
      HelloWorldWeb -> D:\$Data\mhtest\HelloWorldWeb\bin\HelloWorldWeb.dll
    ------ Publish started: Project: HelloWorldWeb, Configuration: Debug Any CPU ------
    Transformed Web.config using Web.Debug.config into obj\Debug\TransformWebConfig\transformed\Web.config.
    Auto ConnectionString Transformed Account\Web.config into obj\Debug\CSAutoParameterize\transformed\Account\Web.config.
    Auto ConnectionString Transformed obj\Debug\TransformWebConfig\transformed\Web.config into obj\Debug\CSAutoParameterize\transformed\Web.config.
    Copying all files to temporary location below for package/publish:
    obj\Debug\Package\PackageTmp.
    Start Web Deploy Publish the Application/package to http://www.myserver.com/MSDEPLOYAGENTSERVICE ...
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3847,5): Error : Web deployment task failed.(Remote agent (URL http://www.myserver.com/MSDEPLOYAGENTSERVICE) could not be contacted.  Make sure the remote agent service is installed and started on the target computer.)
    Make sure the site name, user name, and password are correct. If the issue is not resolved, please contact your local or server administrator.
    Error details:
    Remote agent (URL http://www.myserver.com/MSDEPLOYAGENTSERVICE) could not be contacted.  Make sure the remote agent service is installed and started on the target computer.
    An unsupported response was received. The response header 'MSDeploy.Response' was 'V1' but 'v1' was expected.
    The remote server returned an error: (401) Unauthorized.
    Publish failed to deploy.
    ========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
    ========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

到目前为止,我已经:


  • IIS服务器上已安装的Web Deploy 3.0

  • 已安装Web管理服务,虽然我认为我还没有尝试使用它,但我想暂时在端口80上做所有这些(而不是8172)。

  • 确保服务MsDepSvc作为管理员成员的用户运行

  • 确保我在部署期间在VS2010中使用的凭据是Administrators成员的用户

  • 确保我输入的网站和应用程序与IIS服务器上已存在的内容相匹配

  • Installed Web Deploy 3.0 on the IIS server
  • Installed Web Management Service, although I don't think I'm attempting to use this yet, I want to do all this over port 80 for the time being (as opposed to 8172).
  • Ensured the service MsDepSvc is running as a user who is a member of Administrators
  • Ensured the credentials I use in VS2010 during deploy is a user who is a member of Administrators
  • Ensured the site and the application I've entered match what's already in existence on the IIS server

其他详细信息:


  • IIS服务器是远程的,位于防火墙后面,而不是我工作站的域。我假设我应该使用Basic Auth这样做,虽然我找不到指定它的方法,如果它不是默认值。

  • 如果我打开一个浏览器并导航到 http://www.myserver.com/MSDEPLOYAGENTSERVICE ,果然我被提示输入凭据。如果我输入有效的管理员凭据,我会看到一个空白屏幕 - 网络跟踪显示服务器以401响应。

  • The IIS server is remote, behind a firewall, not on my workstation's domain. I assume I should be doing this using Basic Auth, although I cann't find a way to specify this if it's not already the default.
  • If I open a browswer and navigate to http://www.myserver.com/MSDEPLOYAGENTSERVICE, sure enough I'm prompted for credentials. If I key in valid admin credentials, I get a blank screen - network tracing shows that the server responded with a 401.

推荐答案

我设法让它运转起来。我回到了故障排除文档:
http://www.iis.net/learn/publish/troubleshooting-web-deploy/troubleshooting-common-problems-with-web-deploy

I managed to get it working. I returned to a troubleshooting document: http://www.iis.net/learn/publish/troubleshooting-web-deploy/troubleshooting-common-problems-with-web-deploy

大约三分之一的时间它引用401错误,我更仔细地阅读:

About a third of the way down it references 401 errors, I read it more closely:

症状

Microsoft.Web.Deployment.DeploymentException:

Could not complete the request to remote agent URL 'http://DestinationServer/msdeployAgentService'. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.

ROOT CAUSE

ROOT CAUSE

远程代理服务要求调用方是Administrators组的成员,或者是已添加到Administrators组的域帐户。 由于Web Deploy 2.0中存在错误,不是内置帐户的本地管理员将无法使用Remote Agent服务。

Remote Agent Service requires that the caller is a member of the Administrators group or from a domain account that has been added to the Administrators group. A local administrator which is not the built-in account will not work with the Remote Agent Service because of a bug in Web Deploy 2.0.

FIX / WORKAROUND

FIX/WORKAROUND

提供管理凭证

所以,我不需要使用一个管理员帐户,我需要使用管理员帐户。我可能第一次注意到它,如果它没有使用令人困惑的双阴性,并清楚当前版本中存在的错误,即在撰写本文时为3.0。

So, I didn't need to use "an" administrator account, I needed to use "the" Administrator account. I might have noticed this the first time if it didn't use a confusing double-negative and was clear about the bug also existing in the current version, i.e. 3.0 at the time of writing.

这篇关于Web Deploy 3.0在发布时激怒了401错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆