简体   繁体   English

从DefaultAppPool下运行msdeploy.exe会产生奇怪的行为

[英]Run msdeploy.exe from under DefaultAppPool produces weird behaviour

Intro 介绍

I have this ASP.NET web app and I'd like to provide its users a way to update the app via POST request with zip file which contains the newer version of the app. 我有这个ASP.NET Web应用程序,我想为其用户提供一种通过POST请求通过zip文件更新该应用程序的方法,该文件包含该应用程序的较新版本。

While successefully receiving, storing and using the zip file, I found that msdeploy.exe program does not work, meaning my app is not getting updated. 成功接收,存储和使用zip文件时,我发现msdeploy.exe程序无法正常工作,这意味着我的应用程序没有得到更新。

I am using the following command line syntax: 我正在使用以下命令行语法:

msdeploy -verb:sync -source:package={0} -dest:auto -enableRule:DoNotDeleteRule

(where {0} is replaced by enquoted full path to the zip file) (其中{0}被替换为zip文件的完整路径)

The issue 问题

While successefully installing the update via Windows© Shell manually, I fail to do so when I start msdeploy from withing my web application. 虽然通过Windows©Shell手动成功安装了更新, msdeploy从Web应用程序启动msdeploy 没有这样做 The code I'm using: 我正在使用的代码:

ProcessStartInfo info = new ProcessStartInfo()
{
    FileName = Path.Combine(workingDir, "msdeploy.exe"),
    WorkingDirectory = workingDir,
    CreateNoWindow = true,
    Arguments = @"-verb:sync -source:package={0} -dest:auto -enableRule:DoNotDeleteRule -verbose".Formatted(filename.Enquote()),
    UseShellExecute = false,
    RedirectStandardOutput = true,
};

Process deploy = Process.Start(info);
deploy.Start();

Debugging attempts 调试尝试

I have redirected the program's output into a file so I could compare it to the ideal one, the manual way one which actually works. 我已将程序的输出重定向到一个文件中,因此可以将其与理想的文件进行比较,即一种实际可行的手动方法。

Working msdeploy output (run via my windows account + windows shell): 有效的msdeploy输出(通过我的Windows帐户+ Windows Shell运行):

Info: Updating file (Default Web Site/ElQueue\bin\AutoMapper.dll).
Info: Updating file (Default Web Site/ElQueue\bin\Contracts.dll).
...
Info: Updating file (Default Web Site/ElQueue\Views\Web.config).
Info: Updating file (Default Web Site/ElQueue\Web.config).
Info: Adding ACL's for path (Default Web Site/ElQueue)
Info: Adding ACL's for path (Default Web Site/ElQueue)
Total changes: 27 (1 added, 0 deleted, 26 updated, 0 parameters changed, 803122 bytes copied)

Non-working msdeploy output (run via Process.Start hence IIS AppPool\\DefaultAppPool IIS' virtual account): msdeploy输出msdeploy (通过Process.Start运行,因此是IIS AppPool \\ DefaultAppPool IIS的虚拟帐户):

Warning: BACKUP_FAILED - Skipping backup because it failed due to an unknown reason.яFor more information, contact your server administrator.
Info: Adding sitemanifest (sitemanifest).
Info: Creating application (Default Web Site/ElQueue)

And, that's all. 就这样。 Not much. 不多。 No file updates, no nothing. 没有文件更新,什么都没有。 The application's files remain unchanged. 应用程序的文件保持不变。

SO, how to update my web app the right way ? 因此,如何以正确的方式更新我的Web应用程序?

I thought msdeploy is the way, but its seems not to work with default IIS app pool. 我以为msdeploy是这样,但是它似乎无法与默认的IIS应用程序池一起使用。

How do you authenticate your users? 您如何验证您的用户? If it's Windows authentication the best option would be to configure Web deployment delegation rule . 如果是Windows身份验证,最好的选择是配置Web部署委托规则 Making your pool account identity part of local Administrators may have serious security issues. 使您的池帐户身份成为本地管理员的一部分可能会遇到严重的安全问题。

通过使用lusrmgr.msc管理控制台工具将IIS AppPool\\DefaultAppPool用户添加到Administrators组中来解决此问题,然后在此之后重新启动。

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

相关问题 使用清单会从MSDeploy.exe中给出错误“无法识别参数” - Using Manifest gives an error 'parameter is not recognized' from MSDeploy.exe VSTS msdeploy.exe错误:ERROR_USER_NOT_AUTHORIZED_FOR_CONTENTPATH - VSTS msdeploy.exe error: ERROR_USER_NOT_AUTHORIZED_FOR_CONTENTPATH MSDeploy.exe可以作为管理员连接,但不能以任何其他Windows帐户连接 - MSDeploy.exe can connect as Administrator, but not any other Windows account 通过MSdeploy.exe部署发生错误550 - Error 550 occurred by deploying via MSdeploy.exe 告诉MSDeploy.exe在后续部署中跳过部署一些选择文件 - Tell MSDeploy.exe to skip deploying a few select files in subsequent deployments 需要管理员组中的DefaultAppPool才能运行vb脚本 - Need DefaultAppPool in the administrators group to run vb script DefaultAppPool是否在IIS上带有特殊提升的特权运行? - Does DefaultAppPool run with special elevated privilegs on IIS? MSDeploy和“维护站点”页面 - MSDeploy and “site under maintenance” page 从Web应用程序获取DefaultAppPool AppData文件夹 - Get DefaultAppPool AppData folder from the web application 如何从asp.net Web服务在特定帐户下运行外部exe? - How to run external exe under specific account from asp.net web service?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM