[英]Run msdeploy.exe from under DefaultAppPool produces weird behaviour
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文件的完整路径)
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();
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.
应用程序的文件保持不变。
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.