.net MsDeploy 返回 403 forbidden
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8325259/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
MsDeploy is returning 403 forbidden
提问by dcarneiro
We had a Web Application working on an intranet and I'm trying to publish it to the internet using Visual Studio 2010. The destination server is running iis7 and the Web Management Service is running.
我们有一个在 Intranet 上运行的 Web 应用程序,我正在尝试使用 Visual Studio 2010 将其发布到 Internet。目标服务器正在运行 iis7,并且正在运行 Web 管理服务。
On Visual Studio 2010 my service URL is:
在 Visual Studio 2010 上,我的服务 URL 是:
And site/application is:
站点/应用程序是:
Default Web Site/WebApp
默认网站/WebApp
Marking as IIS App on destination and Allow untrusted certificate is checked and i'm using an administration account.
已选中在目标上标记为 IIS 应用程序并允许不受信任的证书,并且我正在使用管理帐户。
Visual Studio return the following error:
Visual Studio 返回以下错误:
Start Web Deploy Publish the Application/package to https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd?site=Default%20Web%20Site... C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3588,5): Error : Web deployment task failed.(Remote agent (URL https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd?site=DefaultWeb Site) could not be contacted. Make sure the remote agent service is installed and started on the target computer.)
Remote agent (URL https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd?site=DefaultWeb Site) 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 '' but 'v1' was expected. The remote server returned an error: (403) Forbidden.
启动 Web Deploy 将应用程序/包发布到 https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd?site=Default%20Web%20Site... C:\Program Files\MSBuild\Microsoft\VisualStudio\v10 .0\Web\Microsoft.Web.Publishing.targets(3588,5):错误:Web 部署任务失败。(远程代理(URL https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd?site=无法联系默认网站)。请确保在目标计算机上安装并启动了远程代理服务。)
无法联系远程代理(URL https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd?site=DefaultWeb Site)。确保在目标计算机上安装并启动了远程代理服务。收到了不受支持的响应。响应标头“MSDeploy.Response”为“”,但应为“v1”。 远程服务器返回错误:(403) Forbidden。
Any ideas how to publish it without a valid SSL certificate?
任何想法如何在没有有效 SSL 证书的情况下发布它?
回答by icepicker
If you go into IIS,
Click on the server node in the "Connections" list,
Double click "Management Service" then you are taken to a screen which has an "Enable remote connections" check box.
This checkbox (and the rest of the sreen) maybe greyed out because the service is running. Just click the "Stop" link in the Actions pane, then check the "Enable remote connections" box and any other settings you want to change here, then click 'Apply' and 'Start' on the Actions pane again.
That should hopefully let you connect, with proper credentials, to the service from a remote machine. (If the correct ports and stuff are opened and all that jazz.)
I think this helps your situation. At least you won't get 403's but you may have some other MsDeploy error.
如果您进入 IIS,请
单击“连接”列表中的服务器节点,
双击“管理服务”,然后您将进入一个带有“启用远程连接”复选框的屏幕。
由于服务正在运行,此复选框(以及屏幕的其余部分)可能会变灰。只需单击“操作”窗格中的“停止”链接,然后选中“启用远程连接”框以及您要在此处更改的任何其他设置,然后再次单击“操作”窗格上的“应用”和“开始”。
这应该可以让您使用正确的凭据从远程机器连接到服务。(如果打开了正确的端口和内容以及所有爵士乐。)
我认为这对您的情况有所帮助。至少你不会得到 403'
回答by Lee Gunn
Web Deploy can give you a whole bunch of errors if not setup correctly. Do yourself a favourand use the Web Platform Installer(https://www.microsoft.com/web/downloads/platform.aspx). You should uninstall WebDeploy first if you've already tried to install it. From the WebPI select: "Web Deploy 3.6 for Hosting Servers".
如果没有正确设置,Web Deploy 会给你一大堆错误。帮自己一个忙并使用Web 平台安装程序( https://www.microsoft.com/web/downloads/platform.aspx)。如果您已经尝试安装 WebDeploy,则应先卸载它。从 WebPI 中选择:“Web Deploy 3.6 for Hosting Servers”。
回答by skrunkle
I had the same problem. Talk about jumping through hoops... The solution requires set up of user and deployment permissions etc.
我有同样的问题。谈谈跳过箍......该解决方案需要设置用户和部署权限等。
- after getting the error 'NOT FOUND' as predicted by Cihan Yakar above, I had to change webdeploy (for me it required re-download search for 'WebDeploy_x64_en-US.msi') enabling all options.
- got a new error, always good, ERROR_USER_NOT_AUTHORIZED_FOR_CONTENTPATH. for this I looked at the web deploy errors (see below for link).
- 在得到上面 Cihan Yakar 预测的错误“未找到”后,我不得不更改 webdeploy(对我来说,它需要重新下载搜索“WebDeploy_x64_en-US.msi”)启用所有选项。
- 有一个新错误,总是好的,ERROR_USER_NOT_AUTHORIZED_FOR_CONTENTPATH。为此,我查看了网络部署错误(请参阅下面的链接)。
Diagnosis - A non-administrative user attempted to perform an operation with a Web Deploy provider for which the user is not currently authorized. Resolution - Web Deploy 2.0 setup, by default, creates Management Service Delegation Rules which allow non-administrators to perform operations with this provider. It is possible that a delegation rule required for this provider has not been setup correctly. Workaround: From the Programs Control Panel, run Repair on Web Deploy 2.0. Alternatively, create the delegation rule manually.
诊断 - 非管理用户尝试对用户当前未授权的 Web 部署提供程序执行操作。解决方案 - 默认情况下,Web Deploy 2.0 安装程序创建管理服务委派规则,允许非管理员使用此提供程序执行操作。此提供程序所需的委派规则可能未正确设置。解决方法:从“程序控制面板”中,在 Web Deploy 2.0 上运行修复。或者,手动创建委派规则。
It turns out I had to create it manually from 'Configure the Web Deployment Handler'(see below for link), using this guide to 'Configure WMSVC and IIS Manager Permissions' and 'Create Delegation Rules for Web Deploy Users' sorted the problem.
事实证明,我必须从“配置 Web 部署处理程序”(参见下面的链接)手动创建它,使用本指南“配置 WMSVC 和 IIS 管理器权限”和“为 Web 部署用户创建委派规则”对问题进行了排序。
notes: Diagnosed using 'web deploy error codes' from: http://www.iis.net/learn/publish/troubleshooting-web-deploy/web-deploy-error-codesand eventually configured using processes from 'Configure the Web Deployment Handler': http://www.iis.net/learn/publish/using-web-deploy/configure-the-web-deployment-handler
注意:使用“网络部署错误代码”诊断:http: //www.iis.net/learn/publish/troubleshooting-web-deploy/web-deploy-error-codes并最终使用“配置网络部署”中的流程进行配置处理程序':http: //www.iis.net/learn/publish/using-web-deploy/configure-the-web-deployment-handler
回答by Hoang Tran
In my case, after Enable remote connections checkbox, I need to reinstall Web Deploy to make it work.
就我而言,在启用远程连接复选框后,我需要重新安装 Web 部署以使其工作。

