简体   繁体   English

ws2012r2 主机上的 Web 部署 3.6,从 VS 2015 部署失败并出现 401 错误

[英]Web Deploy 3.6 on ws2012r2 host, deploy from VS 2015 fails with 401 error

This is with Web Deploy 3.6, with properly configured remote management services configured and running on a Windows Server 2012 R2 box, and Visual Studio 2015 on a developer PC using Windows 10, and deploying from Web Deploy invoked from within the IDE.这是使用 Web Deploy 3.6,在 Windows Server 2012 R2 机器上配置并运行正确配置的远程管理服务,在使用 Windows 10 的开发人员 PC 上运行 Visual Studio 2015,并从 IDE 中调用的 Web Deploy 进行部署。 (Update: It appears http is the problem, Web Deploy just doesn't work with http.) (更新:看来 http 是问题所在,Web Deploy 不适用于 http。)

This is a little different than the other questions about Web Deploy failing with 401 errors, in that the error only happens during the real deploy and not during the "validate connection".这与有关 Web 部署因 401 错误而失败的其他问题略有不同,因为错误仅发生在真正的部署期间,而不是在“验证连接”期间。

All the solutions posted for the other two similar questions were tried.已尝试针对其他两个类似问题发布的所有解决方案。 There is a registry hack (UAC issue) and a few other things.有一个注册表黑客(UAC 问题)和其他一些事情。 There are local filesystem permissions to be checked.有要检查的本地文件系统权限。

There must be some NEW bit of trickery required for IIS on Windows Server 2012 R2, with Web Deploy 3.6, to get this "wonderful" technology to consent to work.使用 Web Deploy 3.6 的 Windows Server 2012 R2 上的 IIS 必须有一些新的技巧,才能使这项“出色的”技术同意工作。

It's 2016, and Web Deploy is as infuriating as ever.现在是 2016 年,Web Deploy 一如既往地令人气愤。

网络部署你没有工作?

Web Deploy 3.6 and prior versions seem to have hundreds of major wrinkles, many coming down to having undocumented requirements like https being basically required, and the various bits like msdeploy having hideously complex command line syntax. Web Deploy 3.6 和之前的版本似乎有数百个主要问题,其中许多归结为具有未记录的要求,例如https基本上是必需的,以及诸如msdeploy类的各种位具有msdeploy复杂的命令行语法。

I tried Web Deploy from inside Visual Studio, and it worked against a production system on Azure, but was failing on my in house dev systems.我在 Visual Studio 中尝试了 Web Deploy,它在 Azure 上的生产系统上工作,但在我的内部开发系统上失败了。

It seems to be usable on systems with valid signed certificates from inside visual studio IDE, and if you want to deploy to a developer IIS box, be sure the system is listening on https.它似乎可用于具有来自 Visual Studio IDE 内部的有效签名证书的系统,如果您想部署到开发人员 IIS 框,请确保系统正在侦听 https。 If you use a self-signed certificate, you may need to use this workaround, which lets you deploy from your CI system or your developer command line:如果您使用自签名证书,则可能需要使用此解决方法,它允许您从 CI 系统或开发人员命令行进行部署:

  1. Add https binding to your development or deployment server's site's bindings.将 https 绑定添加到您的开发或部署服务器站点的绑定。

  2. Only push through https with webdeploy, it tends to fail when you use http.只能通过 webdeploy 推送 https,使用 http 时往往会失败。

  3. If you do not have a valid trusted certificate (such as a self signed cert), you can add -allowUntrusted to the command below.如果您没有有效的可信证书(例如自签名证书),您可以在下面的命令中添加 -allowUntrusted。

  4. Find the msdeploy command syntax as it is printed in the Visual Studio IDE's output panel, it will be something like this, then modify it.找到 msdeploy 命令语法,因为它打印在 Visual Studio IDE 的输出面板中,它会是这样的,然后修改它。

Please don't store credentials in plain text.请不要以纯文本形式存储凭据。 I am using a batch file in my CI systems and my secrets are stored in the CI system, and injected into the batch file using %ENVIRONMENT_VARIABLE% syntax.我在 CI 系统中使用批处理文件,我的机密存储在 CI 系统中,并使用%ENVIRONMENT_VARIABLE%语法注入批处理文件。

- ——

  "C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" 
  -source:manifest='C:\Users\...\SourceManifest.xml' 
  -dest:manifest='C:\Users\...\DestinationManifest.xml',
  ComputerName='https://192.168.215.141:8172/msdeploy.axd
  ?site=something',UserName='something',
  Password='something',IncludeAcls='False',AuthType='Basic' 
  -verb:sync -enablerule:AppOffline -enableRule:DoNotDeleteRule 
  -retryAttempts:20 -allowUntrusted

From the command line (or a batch file of your own), something like the above is working for me, even when it STILL fails inside the visual studio IDE.从命令行(或您自己的批处理文件),即使在 Visual Studio IDE 中仍然失败,上述内容也对我有用。 The question remains open in case there is a way to get Web Deploy to actually function inside Visual Studio IDE.如果有办法让 Web 部署在 Visual Studio IDE 中实际运行,这个问题仍然存在。

I have now tested this with a trial Windows Server 2016 vm, and with Windows server 2012 r2, and in my opinion web deploy 3.6 is just broken, and no part of it appears more broken than the wizard/visual publish part of visual studio.我现在已经使用试用版 Windows Server 2016 vm 和 Windows Server 2012 r2 对此进行了测试,在我看来,Web 部署 3.6 刚刚损坏,没有任何部分比 Visual Studio 的向导/视觉发布部分更损坏。

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

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