我在 IIS 网站下有一个子应用程序,我可以使用 Visual Studio 中的发布向导部署它,没问题。
但是,我正在从我们的构建服务器自动化我们的部署,所以我更喜欢直接使用 msdeploy.exe。
我可以部署主网站,但尝试部署子应用程序拒绝工作。
这有效(www.mymainwebsite.co.uk 是 IIS 网站):
msdeploy.exe -source:package='www.mymainwebsite.co.uk\obj\Test\Package\www.mymainwebsite.co.uk.zip' -dest:auto,computerName='https://testweb1:8172/MsDeploy .axd?site=www.mymainwebsite.co.uk',userName='xxx',password='xxx',authtype='Basic',includeAcls='False' -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension - disableLink:CertificateExtension -setParamFile:"www.mymainwebsite.co.uk\obj\Test\Package\www.mymainwebsite.co.uk.SetParameters.xml" -allowUntrustedInfo
这不是(SubApplication 是应用程序路径):
msdeploy.exe -source:package='SubApplication\obj\Test\Package\SubApplication.zip' -dest:auto,computerName='https://testweb1:8172/MsDeploy.axd?site=www.mymainwebsite.co.uk / SubApplication ',userName='xxx',password='xxx',authtype='Basic',includeAcls='False' -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -setParamFile:"SubApplication\obj \Test\Package\SubApplication.SetParameters.xml" -allowUntrustedInfo
错误是:
Error Code: ERROR_USER_UNAUTHORIZED
More Information: Connected to the remote computer ("testweb1") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.
Error: The remote server returned an error: (401) Unauthorized.
正如我所说,这适用于 Visual Studio 发布向导,将 Site/application 属性设置为 www.mymainwebsite.co.uk/SubApplication,所以我知道这不是服务器上的权限问题。
我在 msdeploy 参数中遗漏了什么吗?