错误:无法使用 msdeploy tempagent

问题描述

当使用 msdeploy 将 IIS 应用程序部署到远程服务器时,使用 Web 按需部署 (tempagent) 功能,我收到此错误

./myApp.deploy.cmd : Error: Unable to get the remote environment variable 'WindowsDirectory' on the computer 
'myserver.mydomain.com'.
At line:1 char:1
+ ./myApp.deploy.cmd /T /M:$target /U:$username /P:$ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Error: Unable t...com'.:String) [],remoteexception
    + FullyQualifiedErrorId : NativeCommandError
 
Error: The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_disCONNECTED))
Error count: 1.

我正在使用由 msbuild 中的 Package 目标创建的自动生成的部署脚本。我在所有这些工件所在的目录中运行。这是我运行该脚本的脚本:

$target = 'myserver.mydomain.com'
$username = 'myusername'
$password = 'mypassword'


./myApp.deploy.cmd /T /M:$target /U:$username /P:$password /G:true

这是由 .cmd 脚本生成的脚本,如果我直接运行它会发生同样的错误

SetParameters from:
"C:\Users\MaxCadmin\Desktop\Package\myApp.SetParameters.xml"
You can change IIS Application Name,Physical path,connectionString
or other deploy parameters in the above file.
-------------------------------------------------------
 Start executing msdeploy.exe
-------------------------------------------------------
 "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:package='C:\Users\MaxCadmin\Desktop\Package\myApp.zip' -dest:auto,computerName="myserver.mydomain.com",userName="myusername",password="mypassword",includeAcls="False",tempAgent="true" -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -setParamFile:"C:\Users\MaxCadmin\Desktop\Package\myApp.SetParameters.xml" -whatif 
Info: Using ID 'bce210a0-29f9-4859-8fc2-f308c6ce5e72' for connections to the Remote Server.

我正在使用 tempagent 功能,这样我就不必在我的所有目标上安装 Web Deploy,并将它们全部更新到相同的版本。我更喜欢使用临时代理的前景,完全不需要对目标进行任何特殊配置。我已经确认在这种情况下我的目标没有安装了 Web Deploy。

我相信是临时代理在错误消息的末尾抛出了断开连接错误。我更关心关于无法获取远程变量的错误

为了它的价值,我在远程服务器上创建那个环境变量,值匹配 windir,即 C:\Windows,并证明它存在于一个新的 shell 中。但它根本没有改变错误

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)